1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 17:54:44 +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-retrieval
* #pw-group-fun-tools * #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: * @param array $options Options to modify default behavior:
* - `getMethod` (string): Method to call on each item to retrieve $property (default = "get") * - `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). * - `key` (string|null): Property of Wire objects to use for key of array, or omit (null) for non-associative array (default).

View File

@@ -872,6 +872,7 @@ function InputfieldColumnWidths($target) {
// initialize monitoring events on first run // initialize monitoring events on first run
$('body').addClass('InputfieldColumnWidthsInit'); $('body').addClass('InputfieldColumnWidthsInit');
/*
var changeTimeout = null; var changeTimeout = null;
var checkInputfieldHeightChange = function() { var checkInputfieldHeightChange = function() {
var $this = $(this); var $this = $(this);
@@ -891,6 +892,7 @@ function InputfieldColumnWidths($target) {
$(document).on('change', '.InputfieldColumnWidth :input', checkInputfieldHeightChange); $(document).on('change', '.InputfieldColumnWidth :input', checkInputfieldHeightChange);
$(document).on('AjaxUploadDone', '.InputfieldFileList', checkInputfieldHeightChange); $(document).on('AjaxUploadDone', '.InputfieldFileList', checkInputfieldHeightChange);
$(document).on('heightChanged', '.InputfieldColumnWidth', checkInputfieldHeightChange); $(document).on('heightChanged', '.InputfieldColumnWidth', checkInputfieldHeightChange);
*/
} }
} }
@@ -1191,6 +1193,7 @@ function InputfieldStates($target) {
InputfieldColumnWidths(); InputfieldColumnWidths();
} else { } else {
$li.trigger('reloaded', [ 'InputfieldAjaxLoad' ]); $li.trigger('reloaded', [ 'InputfieldAjaxLoad' ]);
InputfieldColumnWidths();
} }
if($li.closest('.InputfieldFormNoDependencies').length == 0) { if($li.closest('.InputfieldFormNoDependencies').length == 0) {
InputfieldDependencies($li.parent()); InputfieldDependencies($li.parent());
@@ -1535,6 +1538,20 @@ jQuery(document).ready(function($) {
$(document).on('reload', '.Inputfield', InputfieldReloadEvent); $(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: // for testing:
$(document).on('reloaded', '.Inputfield', function(event) { $(document).on('reloaded', '.Inputfield', function(event) {

File diff suppressed because one or more lines are too long