1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-21 22:06:12 +02:00

Update for processwire/processwire-issues#517 and ryancramerdesign/AdminThemeUikit#46 correct issue where InputfieldImage defined buttonClass wasn't getting used in repeaters, plus update the Uikit custom button class to not be applied when InputfieldImage::renderButtons() is hooked, in order to avoid two different button styes appearing when other modules add buttons to it.

This commit is contained in:
Ryan Cramer
2018-03-08 10:56:32 -05:00
parent bd3be5e315
commit 5da4e17a27
4 changed files with 16 additions and 10 deletions

View File

@@ -108,9 +108,11 @@ $config->set('ProcessList', array(
'showIcon' => true,
));
$buttonClassKey = $config->wire('hooks')->isHooked('InputfieldImage::renderButtons()') ? '_buttonClass' : 'buttonClass';
$config->set('InputfieldImage', array(
'buttonClass' => "uk-button uk-button-small uk-button-text uk-margin-small-right",
'buttonText' => "{out}",
// only use custom classes if renderButtons is not hooked
$buttonClassKey => 'uk-button uk-button-small uk-button-text uk-margin-small-right',
'buttonText' => '{out}',
));
$config->set('InputfieldFile', array(

View File

@@ -2248,9 +2248,9 @@ function InputfieldImage($) {
if(typeof data != "undefined" && data.length) {
data = data.split(';');
settings.maxWidth = parseInt(data[0]);
settings.maxHeight = parseInt(data[1]);
settings.maxSize = parseFloat(data[2]);
settings.maxWidth = data[0].length ? parseInt(data[0]) : 0;
settings.maxHeight = data[1].length ? parseInt(data[1]) : 0;
settings.maxSize = data[2].length ? parseFloat(data[2]) : 0;
settings.quality = parseFloat(data[3]);
}

File diff suppressed because one or more lines are too long

View File

@@ -180,10 +180,14 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
if(!$renderValueMode && $this->focusMode == 'zoom') {
$this->addClass('InputfieldImageFocusZoom', 'wrapClass');
}
$config->js('InputfieldImage', array(
'labels' => $this->labels,
));
$settings = $config->get('InputfieldImage');
if(!is_array($settings)) $settings = array();
if(empty($settings['ready'])) {
$settings['labels'] = $this->labels;
$settings['ready'] = true;
$config->js('InputfieldImage', $settings);
}
// client side image resize
if(!$this->resizeServer && ($this->maxWidth || $this->maxHeight || $this->maxSize)) {