1/** 2 * @module ãªã³ã¯ 3 */ 4 5const data = { 6 initialized: {}, 7}; 8 9/** 10 * BOXå ¨ä½ã®ãªã³ã¯å¦ç 11 * 12 * @param {Object} [options] - ãªãã·ã§ã³ 13 * @param {string} [options.event] - ã¤ãã³ãã¿ã¤ã 14 * @param {string} [options.targetSelector] - 対象ã¨ãªãè¦ç´ ã®ã»ã¬ã¯ã¿ 15 */ 16export const setEventBox = function (options = {}) { 17 if (data.initialized.setEventBox) { 18 return; 19 } 20 21 data.initialized.setEventBox = true; 22 23 const settings = { 24 event: 'click', 25 targetSelector: '.js-box-link,.js-box-blank', 26 ...options, 27 }; 28 29 $(document).on(settings.event, settings.targetSelector, (e) => { 30 const target = $(e.target); 31 if (!(target.closest('a,label,button,input').length)) { 32 if (!(target.parents().hasClass('unLink'))) { 33 const obj = $(e.currentTarget); 34 if (obj.hasClass('js-box-blank')) { 35 window.open(obj.attr('data-url'), '_blank'); 36 } else { 37 window.location = obj.attr('data-url'); 38 } 39 return false; 40 } 41 } 42 43 return true; 44 }); 45}; 46 47export default setEventBox;
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.