1!function ($) { 2 var ba_modal = function (element) { 3 this.element = $(element).on('click.ba_modal', '[data-dismiss="ba_modal"]', $.proxy(this.hide, this)); 4 this.element.parent().children().on('mouseenter', this, function(){ 5 $(this).parent().off('click.ba_modal'); 6 }).on('mouseleave', $.proxy(this.scrollable, this)); 7 this.scrollable(); 8 $('body').append(this.element.parent()); 9 } 10 11 ba_modal.prototype = { 12 show: function () { 13 const scroll = window.innerWidth - document.documentElement.offsetWidth; 14 document.documentElement.style.setProperty('--gallery-scroll-width', `${scroll}px`); 15 const event = $.Event('show'); 16 this.element.trigger(event); 17 this.element.show(); 18 this.element.addClass('in'); 19 this.element.parent().show(); 20 }, 21 hide: function (event) { 22 if (!event || !event.target || event.target.classList.contains('modal-scrollable')) { 23 const element = this.element; 24 event && event.preventDefault(); 25 event = $.Event('hide'); 26 this.element.trigger(event); 27 setTimeout(function(){ 28 element.removeClass('in'); 29 element.hide(); 30 element.parent().hide(); 31 }, 500); 32 } 33 }, 34 scrollable : function(){ 35 this.element.parent().on('click.ba_modal', $.proxy(this.hide, this)); 36 } 37 } 38 39 $.fn.ba_modal = function (option) { 40 return this.each(function () { 41 let data = $(this).data('ba_modal'); 42 if (!data) { 43 $(this).data('ba_modal', (data = new ba_modal(this))); 44 } 45 if (typeof option == 'string') { 46 data[option](); 47 } else { 48 data.show(); 49 } 50 }); 51 } 52 53 $.fn.ba_modal.Constructor = ba_modal 54 55}(window.jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.