* Views dialog behaviors.
*/
-(function ($, Drupal, drupalSettings) {
+(function($, Drupal, drupalSettings) {
function handleDialogResize(e) {
const $modal = $(e.currentTarget);
const $viewsOverride = $modal.find('[data-drupal-views-offset]');
// Let scroll element take all the height available.
$scroll.css({ overflow: 'visible', height: 'auto' });
modalHeight = $modal.height();
- $viewsOverride.each(function () {
+ $viewsOverride.each(function() {
offset += $(this).outerHeight();
});
*/
Drupal.behaviors.viewsModalContent = {
attach(context) {
- $('body').once('viewsDialog').on('dialogContentResize.viewsDialog', '.ui-dialog-content', handleDialogResize);
+ $('body')
+ .once('viewsDialog')
+ .on(
+ 'dialogContentResize.viewsDialog',
+ '.ui-dialog-content',
+ handleDialogResize,
+ );
// When expanding details, make sure the modal is resized.
- $(context).find('.scroll').once('detailsUpdate').on('click', 'summary', (e) => {
- $(e.currentTarget).trigger('dialogContentResize');
- });
+ $(context)
+ .find('.scroll')
+ .once('detailsUpdate')
+ .on('click', 'summary', e => {
+ $(e.currentTarget).trigger('dialogContentResize');
+ });
},
detach(context, settings, trigger) {
if (trigger === 'unload') {
- $('body').removeOnce('viewsDialog').off('.viewsDialog');
+ $('body')
+ .removeOnce('viewsDialog')
+ .off('.viewsDialog');
}
},
};
-}(jQuery, Drupal, drupalSettings));
+})(jQuery, Drupal, drupalSettings);