1(() => { 2 'use strict'; 3 4 function focusTrapFacade(element, options) { 5 var trap; 6 7 function load() { 8 return new Promise(resolve => { 9 if (trap) { 10 return resolve(trap); 11 } 12 13 require(['focus-trap'], () => { 14 trap = window.focusTrap.createFocusTrap(element, options); 15 resolve(trap); 16 }); 17 }); 18 } 19 20 return { 21 async activate(opts) { 22 return (await load()).activate(opts); 23 }, 24 25 async deactivate(opts) { 26 return trap?.deactivate(opts); 27 } 28 }; 29 } 30 31 $.breeze.focusTrap = {}; 32 $.breeze.focusTrap.createFocusTrap = function (element, options) { 33 return new focusTrapFacade(element, $.extend({ 34 allowOutsideClick: true, 35 escapeDeactivates: false 36 }, options || {})); 37 }; 38 39 $.fn.focusTrap = function (flag, options) { 40 if (!this.data('__focusTrap')) { 41 this.data('__focusTrap', $.breeze.focusTrap.createFocusTrap(this[0], options)); 42 } 43 this.data('__focusTrap')[flag ? 'activate' : 'deactivate'](); 44 return this; 45 }; 46})();
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.