Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / views_ui / js / dialog.views.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Drupal, drupalSettings) {
9   function handleDialogResize(e) {
10     var $modal = $(e.currentTarget);
11     var $viewsOverride = $modal.find('[data-drupal-views-offset]');
12     var $scroll = $modal.find('[data-drupal-views-scroll]');
13     var offset = 0;
14     var modalHeight = void 0;
15     if ($scroll.length) {
16       $modal.closest('.views-ui-dialog').addClass('views-ui-dialog-scroll');
17
18       $scroll.css({ overflow: 'visible', height: 'auto' });
19       modalHeight = $modal.height();
20       $viewsOverride.each(function () {
21         offset += $(this).outerHeight();
22       });
23
24       var scrollOffset = $scroll.outerHeight() - $scroll.height();
25       $scroll.height(modalHeight - offset - scrollOffset);
26
27       $modal.css('overflow', 'hidden');
28       $scroll.css('overflow', 'auto');
29     }
30   }
31
32   Drupal.behaviors.viewsModalContent = {
33     attach: function attach(context) {
34       $('body').once('viewsDialog').on('dialogContentResize.viewsDialog', '.ui-dialog-content', handleDialogResize);
35
36       $(context).find('.scroll').once('detailsUpdate').on('click', 'summary', function (e) {
37         $(e.currentTarget).trigger('dialogContentResize');
38       });
39     },
40     detach: function detach(context, settings, trigger) {
41       if (trigger === 'unload') {
42         $('body').removeOnce('viewsDialog').off('.viewsDialog');
43       }
44     }
45   };
46 })(jQuery, Drupal, drupalSettings);