%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/ava/calendar/amd/build/
Upload File :
Create Path :
Current File : /home/vacivi36/ava/calendar/amd/build/popover.min.js.map

{"version":3,"file":"popover.min.js","sources":["../src/popover.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Javascript popover for the `core_calendar` subsystem.\n *\n * @module core_calendar/popover\n * @copyright 2021 Huong Nguyen <huongnv13@gmail.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\nimport 'theme_boost/popover';\nimport jQuery from 'jquery';\nimport * as CalendarSelectors from 'core_calendar/selectors';\n\n/**\n * Check if we are allowing to enable the popover or not.\n * @param {Element} dateContainer\n * @returns {boolean}\n */\nconst isPopoverAvailable = (dateContainer) => {\n    return window.getComputedStyle(dateContainer.querySelector(CalendarSelectors.elements.dateContent)).display === 'none';\n};\n\nconst isPopoverConfigured = new Map();\n\nconst showPopover = target => {\n    if (!isPopoverConfigured.has(target)) {\n        const dateEle = jQuery(target);\n        dateEle.popover({\n            trigger: 'manual',\n            placement: 'top',\n            html: true,\n            content: () => {\n                const source = dateEle.find(CalendarSelectors.elements.dateContent);\n                const content = jQuery('<div>');\n                if (source.length) {\n                    const temptContent = source.find('.hidden').clone(false);\n                    content.html(temptContent.html());\n                }\n                return content.html();\n            }\n        });\n\n        isPopoverConfigured.set(target, true);\n    }\n\n    if (isPopoverAvailable(target)) {\n        jQuery(target).popover('show');\n        target.addEventListener('mouseleave', hidePopover);\n        target.addEventListener('focusout', hidePopover);\n    }\n};\n\nconst hidePopover = e => {\n    const target = e.target;\n    const dateContainer = e.target.closest(CalendarSelectors.elements.dateContainer);\n    if (!dateContainer) {\n        return;\n    }\n    if (isPopoverConfigured.has(dateContainer)) {\n        const isTargetActive = target.contains(document.activeElement);\n        const isTargetHover = target.matches(':hover');\n        if (!isTargetActive && !isTargetHover) {\n            jQuery(dateContainer).popover('hide');\n            dateContainer.removeEventListener('mouseleave', hidePopover);\n            dateContainer.removeEventListener('focusout', hidePopover);\n        }\n    }\n};\n\n/**\n * Register events for date container.\n */\nconst registerEventListeners = () => {\n    const showPopoverHandler = (e) => {\n        const dateContainer = e.target.closest(CalendarSelectors.elements.dateContainer);\n        if (!dateContainer) {\n            return;\n        }\n\n        e.preventDefault();\n        showPopover(dateContainer);\n    };\n\n    document.addEventListener('mouseover', showPopoverHandler);\n    document.addEventListener('focusin', showPopoverHandler);\n};\n\nlet listenersRegistered = false;\nif (!listenersRegistered) {\n    registerEventListeners();\n    listenersRegistered = true;\n}\n"],"names":["isPopoverConfigured","Map","showPopover","target","has","dateEle","popover","trigger","placement","html","content","source","find","CalendarSelectors","elements","dateContent","length","temptContent","clone","set","dateContainer","window","getComputedStyle","querySelector","display","addEventListener","hidePopover","e","closest","isTargetActive","contains","document","activeElement","isTargetHover","matches","removeEventListener","listenersRegistered","showPopoverHandler","preventDefault","registerEventListeners"],"mappings":";;;;;;;;wgCAqCMA,oBAAsB,IAAIC,IAE1BC,YAAcC,aACXH,oBAAoBI,IAAID,QAAS,OAC5BE,SAAU,mBAAOF,QACvBE,QAAQC,QAAQ,CACZC,QAAS,SACTC,UAAW,MACXC,MAAM,EACNC,QAAS,WACCC,OAASN,QAAQO,KAAKC,kBAAkBC,SAASC,aACjDL,SAAU,mBAAO,YACnBC,OAAOK,OAAQ,OACTC,aAAeN,OAAOC,KAAK,WAAWM,OAAM,GAClDR,QAAQD,KAAKQ,aAAaR,eAEvBC,QAAQD,UAIvBT,oBAAoBmB,IAAIhB,QAAQ,GAxBZiB,IAAAA,cAAAA,cA2BDjB,OA1ByF,SAAzGkB,OAAOC,iBAAiBF,cAAcG,cAAcV,kBAAkBC,SAASC,cAAcS,8BA2BzFrB,QAAQG,QAAQ,QACvBH,OAAOsB,iBAAiB,aAAcC,aACtCvB,OAAOsB,iBAAiB,WAAYC,eAItCA,YAAcC,UACVxB,OAASwB,EAAExB,OACXiB,cAAgBO,EAAExB,OAAOyB,QAAQf,kBAAkBC,SAASM,kBAC7DA,eAGDpB,oBAAoBI,IAAIgB,eAAgB,OAClCS,eAAiB1B,OAAO2B,SAASC,SAASC,eAC1CC,cAAgB9B,OAAO+B,QAAQ,UAChCL,gBAAmBI,oCACbb,eAAed,QAAQ,QAC9Bc,cAAce,oBAAoB,aAAcT,aAChDN,cAAce,oBAAoB,WAAYT,oBAuBtDU,qBAAsB,EACrBA,sBAhB0B,YACrBC,mBAAsBV,UAClBP,cAAgBO,EAAExB,OAAOyB,QAAQf,kBAAkBC,SAASM,eAC7DA,gBAILO,EAAEW,iBACFpC,YAAYkB,iBAGhBW,SAASN,iBAAiB,YAAaY,oBACvCN,SAASN,iBAAiB,UAAWY,qBAKrCE,GACAH,qBAAsB"}

Zerion Mini Shell 1.0