1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-21 05:51:41 +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, 'showIcon' => true,
)); ));
$buttonClassKey = $config->wire('hooks')->isHooked('InputfieldImage::renderButtons()') ? '_buttonClass' : 'buttonClass';
$config->set('InputfieldImage', array( $config->set('InputfieldImage', array(
'buttonClass' => "uk-button uk-button-small uk-button-text uk-margin-small-right", // only use custom classes if renderButtons is not hooked
'buttonText' => "{out}", $buttonClassKey => 'uk-button uk-button-small uk-button-text uk-margin-small-right',
'buttonText' => '{out}',
)); ));
$config->set('InputfieldFile', array( $config->set('InputfieldFile', array(

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -181,9 +181,13 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
$this->addClass('InputfieldImageFocusZoom', 'wrapClass'); $this->addClass('InputfieldImageFocusZoom', 'wrapClass');
} }
$config->js('InputfieldImage', array( $settings = $config->get('InputfieldImage');
'labels' => $this->labels, 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 // client side image resize
if(!$this->resizeServer && ($this->maxWidth || $this->maxHeight || $this->maxSize)) { if(!$this->resizeServer && ($this->maxWidth || $this->maxHeight || $this->maxSize)) {