1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +02:00

Add AdminThemeDefault/AdminThemeReno column widths fix as suggested by @Toutouwai in processwire/processwire-issues#306 plus add typo fix per processwire/processwire-issues#797

This commit is contained in:
Ryan Cramer
2019-03-26 11:00:11 -04:00
parent f121425f0d
commit cf2be06dfc
3 changed files with 22 additions and 5 deletions

View File

@@ -2047,7 +2047,7 @@ class WireArray extends Wire implements \IteratorAggregate, \ArrayAccess, \Count
* #pw-group-retrieval
* #pw-group-fun-tools
*
* @param string|callable|array $property Property or properties to retrieve, or callable function that shuld receive items.
* @param string|callable|array $property Property or properties to retrieve, or callable function that should receive items.
* @param array $options Options to modify default behavior:
* - `getMethod` (string): Method to call on each item to retrieve $property (default = "get")
* - `key` (string|null): Property of Wire objects to use for key of array, or omit (null) for non-associative array (default).

View File

@@ -871,7 +871,8 @@ function InputfieldColumnWidths($target) {
} else if(!$('body').hasClass('InputfieldColumnWidthsInit')) {
// initialize monitoring events on first run
$('body').addClass('InputfieldColumnWidthsInit');
/*
var changeTimeout = null;
var checkInputfieldHeightChange = function() {
var $this = $(this);
@@ -887,10 +888,11 @@ function InputfieldColumnWidths($target) {
checkNow();
}
};
$(document).on('change', '.InputfieldColumnWidth :input', checkInputfieldHeightChange);
$(document).on('AjaxUploadDone', '.InputfieldFileList', checkInputfieldHeightChange);
$(document).on('heightChanged', '.InputfieldColumnWidth', checkInputfieldHeightChange);
*/
}
}
@@ -1191,6 +1193,7 @@ function InputfieldStates($target) {
InputfieldColumnWidths();
} else {
$li.trigger('reloaded', [ 'InputfieldAjaxLoad' ]);
InputfieldColumnWidths();
}
if($li.closest('.InputfieldFormNoDependencies').length == 0) {
InputfieldDependencies($li.parent());
@@ -1505,7 +1508,7 @@ function InputfieldsInit($target) {
/***********************************************************************************/
jQuery(document).ready(function($) {
InputfieldStates();
InputfieldDependencies($(".InputfieldForm:not(.InputfieldFormNoDependencies)"));
@@ -1534,6 +1537,20 @@ jQuery(document).ready(function($) {
InputfieldRequirements($('.InputfieldForm'));
$(document).on('reload', '.Inputfield', InputfieldReloadEvent);
if($('.InputfieldForm:not(.InputfieldFormNoWidths)').length) {
$(document).on('change', '.InputfieldColumnWidth :input', function() {
InputfieldColumnWidths(); // For fields with immediate height change (e.g. AsmSelect)
setTimeout(InputfieldColumnWidths, 300); // For fields with delayed height change (e.g. Files delete)
});
$(document).on('AjaxUploadDone', '.InputfieldFileList', function() {
InputfieldColumnWidths();
});
$(document).on('heightChanged', '.InputfieldColumnWidth', function() {
InputfieldColumnWidths();
});
}
/*
// for testing:

File diff suppressed because one or more lines are too long