updated core to 8.6.1 via composer
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Provides date format preview feature.
|
||||
*/
|
||||
|
||||
(function ($, Drupal, drupalSettings) {
|
||||
(function($, Drupal, drupalSettings) {
|
||||
const dateFormats = drupalSettings.dateFormats;
|
||||
|
||||
/**
|
||||
@@ -17,8 +17,12 @@
|
||||
Drupal.behaviors.dateFormat = {
|
||||
attach(context) {
|
||||
const $context = $(context);
|
||||
const $source = $context.find('[data-drupal-date-formatter="source"]').once('dateFormat');
|
||||
const $target = $context.find('[data-drupal-date-formatter="preview"]').once('dateFormat');
|
||||
const $source = $context
|
||||
.find('[data-drupal-date-formatter="source"]')
|
||||
.once('dateFormat');
|
||||
const $target = $context
|
||||
.find('[data-drupal-date-formatter="preview"]')
|
||||
.once('dateFormat');
|
||||
const $preview = $target.find('em');
|
||||
|
||||
// All elements have to exist.
|
||||
@@ -34,7 +38,10 @@
|
||||
*/
|
||||
function dateFormatHandler(e) {
|
||||
const baseValue = $(e.target).val() || '';
|
||||
const dateString = baseValue.replace(/\\?(.?)/gi, (key, value) => (dateFormats[key] ? dateFormats[key] : value));
|
||||
const dateString = baseValue.replace(
|
||||
/\\?(.?)/gi,
|
||||
(key, value) => (dateFormats[key] ? dateFormats[key] : value),
|
||||
);
|
||||
|
||||
$preview.html(dateString);
|
||||
$target.toggleClass('js-hide', !dateString.length);
|
||||
@@ -43,9 +50,13 @@
|
||||
/**
|
||||
* On given event triggers the date character replacement.
|
||||
*/
|
||||
$source.on('keyup.dateFormat change.dateFormat input.dateFormat', dateFormatHandler)
|
||||
$source
|
||||
.on(
|
||||
'keyup.dateFormat change.dateFormat input.dateFormat',
|
||||
dateFormatHandler,
|
||||
)
|
||||
// Initialize preview.
|
||||
.trigger('keyup');
|
||||
},
|
||||
};
|
||||
}(jQuery, Drupal, drupalSettings));
|
||||
})(jQuery, Drupal, drupalSettings);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* System behaviors.
|
||||
*/
|
||||
|
||||
(function ($, Drupal, drupalSettings) {
|
||||
(function($, Drupal, drupalSettings) {
|
||||
// Cache IDs in an array for ease of use.
|
||||
const ids = [];
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
attach(context) {
|
||||
// List of fields IDs on which to bind the event listener.
|
||||
// Create an array of IDs to use with jQuery.
|
||||
Object.keys(drupalSettings.copyFieldValue || {}).forEach((element) => {
|
||||
Object.keys(drupalSettings.copyFieldValue || {}).forEach(element => {
|
||||
ids.push(element);
|
||||
});
|
||||
|
||||
@@ -31,15 +31,23 @@
|
||||
// Listen to value:copy events on all dependent fields.
|
||||
// We have to use body and not document because of the way jQuery events
|
||||
// bubble up the DOM tree.
|
||||
$('body').once('copy-field-values').on('value:copy', this.valueTargetCopyHandler);
|
||||
$('body')
|
||||
.once('copy-field-values')
|
||||
.on('value:copy', this.valueTargetCopyHandler);
|
||||
// Listen on all source elements.
|
||||
$(`#${ids.join(', #')}`).once('copy-field-values').on('blur', this.valueSourceBlurHandler);
|
||||
$(`#${ids.join(', #')}`)
|
||||
.once('copy-field-values')
|
||||
.on('blur', this.valueSourceBlurHandler);
|
||||
}
|
||||
},
|
||||
detach(context, settings, trigger) {
|
||||
if (trigger === 'unload' && ids.length) {
|
||||
$('body').removeOnce('copy-field-values').off('value:copy');
|
||||
$(`#${ids.join(', #')}`).removeOnce('copy-field-values').off('blur');
|
||||
$('body')
|
||||
.removeOnce('copy-field-values')
|
||||
.off('value:copy');
|
||||
$(`#${ids.join(', #')}`)
|
||||
.removeOnce('copy-field-values')
|
||||
.off('blur');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -73,4 +81,4 @@
|
||||
$(`#${targetIds.join(', #')}`).trigger('value:copy', value);
|
||||
},
|
||||
};
|
||||
}(jQuery, Drupal, drupalSettings));
|
||||
})(jQuery, Drupal, drupalSettings);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Module page behaviors.
|
||||
*/
|
||||
|
||||
(function ($, Drupal, debounce) {
|
||||
(function($, Drupal, debounce) {
|
||||
/**
|
||||
* Filters the module list table by a text input search string.
|
||||
*
|
||||
@@ -38,7 +38,9 @@
|
||||
|
||||
function showModuleRow(index, row) {
|
||||
const $row = $(row);
|
||||
const $sources = $row.find('.table-filter-text-source, .module-name, .module-description');
|
||||
const $sources = $row.find(
|
||||
'.table-filter-text-source, .module-name, .module-description',
|
||||
);
|
||||
const textMatch = $sources.text().search(re) !== -1;
|
||||
$row.closest('tr').toggle(textMatch);
|
||||
}
|
||||
@@ -53,25 +55,26 @@
|
||||
// Note that we first open all <details> to be able to use ':visible'.
|
||||
// Mark the <details> elements that were closed before filtering, so
|
||||
// they can be reclosed when filtering is removed.
|
||||
$details.not('[open]').attr('data-drupal-system-state', 'forced-open');
|
||||
$details
|
||||
.not('[open]')
|
||||
.attr('data-drupal-system-state', 'forced-open');
|
||||
|
||||
// Hide the package <details> if they don't have any visible rows.
|
||||
// Note that we first show() all <details> to be able to use ':visible'.
|
||||
$details.attr('open', true).each(hidePackageDetails);
|
||||
|
||||
Drupal.announce(
|
||||
Drupal.t(
|
||||
'!modules modules are available in the modified list.',
|
||||
{ '!modules': $rowsAndDetails.find('tbody tr:visible').length },
|
||||
),
|
||||
Drupal.t('!modules modules are available in the modified list.', {
|
||||
'!modules': $rowsAndDetails.find('tbody tr:visible').length,
|
||||
}),
|
||||
);
|
||||
}
|
||||
else if (searching) {
|
||||
} else if (searching) {
|
||||
searching = false;
|
||||
$rowsAndDetails.show();
|
||||
// Return <details> elements that had been closed before filtering
|
||||
// to a closed state.
|
||||
$details.filter('[data-drupal-system-state="forced-open"]')
|
||||
$details
|
||||
.filter('[data-drupal-system-state="forced-open"]')
|
||||
.removeAttr('data-drupal-system-state')
|
||||
.attr('open', false);
|
||||
}
|
||||
@@ -96,4 +99,4 @@
|
||||
}
|
||||
},
|
||||
};
|
||||
}(jQuery, Drupal, Drupal.debounce));
|
||||
})(jQuery, Drupal, Drupal.debounce);
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
|
||||
$details.attr('open', true).each(hidePackageDetails);
|
||||
|
||||
Drupal.announce(Drupal.t('!modules modules are available in the modified list.', { '!modules': $rowsAndDetails.find('tbody tr:visible').length }));
|
||||
Drupal.announce(Drupal.t('!modules modules are available in the modified list.', {
|
||||
'!modules': $rowsAndDetails.find('tbody tr:visible').length
|
||||
}));
|
||||
} else if (searching) {
|
||||
searching = false;
|
||||
$rowsAndDetails.show();
|
||||
|
||||
Reference in New Issue
Block a user