mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
7.2 KiB
JSON
1 line
7.2 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n/**\n * When hardwareBackButton: false in config,\n * we need to make sure we also block the default\n * webview behavior. If we don't then it will be\n * possible for users to navigate backward while\n * an overlay is still open. Additionally, it will\n * give the appearance that the hardwareBackButton\n * config is not working as the page transition\n * will still happen.\n */\nconst blockHardwareBackButton = () => {\n document.addEventListener('backbutton', () => {}); // tslint:disable-line\n};\n\nconst startHardwareBackButton = () => {\n const doc = document;\n let busy = false;\n doc.addEventListener('backbutton', () => {\n if (busy) {\n return;\n }\n let index = 0;\n let handlers = [];\n const ev = new CustomEvent('ionBackButton', {\n bubbles: false,\n detail: {\n register(priority, handler) {\n handlers.push({\n priority,\n handler,\n id: index++\n });\n }\n }\n });\n doc.dispatchEvent(ev);\n const executeAction = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (handlerRegister) {\n try {\n if (handlerRegister && handlerRegister.handler) {\n const result = handlerRegister.handler(processHandlers);\n if (result != null) {\n yield result;\n }\n }\n } catch (e) {\n console.error(e);\n }\n });\n return function executeAction(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n const processHandlers = () => {\n if (handlers.length > 0) {\n let selectedHandler = {\n priority: Number.MIN_SAFE_INTEGER,\n handler: () => undefined,\n id: -1\n };\n handlers.forEach(handler => {\n if (handler.priority >= selectedHandler.priority) {\n selectedHandler = handler;\n }\n });\n busy = true;\n handlers = handlers.filter(handler => handler.id !== selectedHandler.id);\n executeAction(selectedHandler).then(() => busy = false);\n }\n };\n processHandlers();\n });\n};\nconst OVERLAY_BACK_BUTTON_PRIORITY = 100;\nconst MENU_BACK_BUTTON_PRIORITY = 99; // 1 less than overlay priority since menu is displayed behind overlays\n\nexport { MENU_BACK_BUTTON_PRIORITY, OVERLAY_BACK_BUTTON_PRIORITY, blockHardwareBackButton, startHardwareBackButton };","map":{"version":3,"names":["blockHardwareBackButton","document","addEventListener","startHardwareBackButton","doc","busy","index","handlers","ev","CustomEvent","bubbles","detail","register","priority","handler","push","id","dispatchEvent","executeAction","_ref","_asyncToGenerator","handlerRegister","result","processHandlers","e","console","error","_x","apply","arguments","length","selectedHandler","Number","MIN_SAFE_INTEGER","undefined","forEach","filter","then","OVERLAY_BACK_BUTTON_PRIORITY","MENU_BACK_BUTTON_PRIORITY"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@ionic/core/dist/esm/hardware-back-button-4a6b37fb.js"],"sourcesContent":["/**\n * When hardwareBackButton: false in config,\n * we need to make sure we also block the default\n * webview behavior. If we don't then it will be\n * possible for users to navigate backward while\n * an overlay is still open. Additionally, it will\n * give the appearance that the hardwareBackButton\n * config is not working as the page transition\n * will still happen.\n */\nconst blockHardwareBackButton = () => {\n document.addEventListener('backbutton', () => { }); // tslint:disable-line\n};\nconst startHardwareBackButton = () => {\n const doc = document;\n let busy = false;\n doc.addEventListener('backbutton', () => {\n if (busy) {\n return;\n }\n let index = 0;\n let handlers = [];\n const ev = new CustomEvent('ionBackButton', {\n bubbles: fa
|