1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00

Minor updates, plus update the inputfields.js triggered events (openReady, opened, closeReady, closed) to include the Inputfield element in the event arguments for simpler access to it vs the event.target.

This commit is contained in:
Ryan Cramer
2020-08-14 15:18:05 -04:00
parent af632b0a4d
commit 6f4a76d74e
5 changed files with 31 additions and 19 deletions

View File

@@ -202,7 +202,7 @@ var Inputfields = {
}
function opened() {
$inputfield.trigger('opened');
$inputfield.trigger('opened', $inputfield);
if($inputfield.hasClass('InputfieldColumnWidth')) {
$inputfield.children('.InputfieldContent').show();
}
@@ -214,7 +214,7 @@ var Inputfields = {
function closed() {
if($inputfield.css('overflow') == 'hidden') $inputfield.css('overflow', '');
$inputfield.trigger('closed');
$inputfield.trigger('closed', $inputfield);
if($inputfield.hasClass('InputfieldColumnWidth')) {
$inputfield.children('.InputfieldContent').hide();
}
@@ -261,7 +261,7 @@ var Inputfields = {
// handle either open or close
if(open && isCollapsed) {
$inputfield.addClass('InputfieldStateToggling').trigger('openReady');
$inputfield.addClass('InputfieldStateToggling').trigger('openReady', $inputfield);
if(duration && jQuery.ui) {
$inputfield.toggleClass('InputfieldStateCollapsed', duration, opened);
} else {
@@ -269,7 +269,7 @@ var Inputfields = {
opened();
}
} else if(!open && !isCollapsed) {
$inputfield.addClass('InputfieldStateToggling').trigger('closeReady');
$inputfield.addClass('InputfieldStateToggling').trigger('closeReady', $inputfield);
if(duration && jQuery.ui) {
$inputfield.toggleClass('InputfieldStateCollapsed', duration, closed);
} else {

File diff suppressed because one or more lines are too long