diff --git a/admin/amd/build/plugin_management_table.min.js b/admin/amd/build/plugin_management_table.min.js index 0dbdbe3e4a0..075c906710d 100644 --- a/admin/amd/build/plugin_management_table.min.js +++ b/admin/amd/build/plugin_management_table.min.js @@ -1,3 +1,3 @@ -define("core_admin/plugin_management_table",["exports","core_table/dynamic","core_table/local/dynamic/selectors","core/ajax","core/pending","core/notification"],(function(_exports,_dynamic,Selectors,_ajax,_pending,_notification){var obj;function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Selectors=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(Selectors),_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};let watching=!1;return _exports.default=class{constructor(){!function(obj,key,value){key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}(this,"clickHandlers",[]),this.addClickHandler(this.handleStateToggle),this.addClickHandler(this.handleMoveUpDown),this.registerEventListeners()}static init(){watching||(watching=!0,new this)}addClickHandler(handler){this.clickHandlers.push(handler.bind(this))}registerEventListeners(){document.addEventListener("click",function(e){const tableRoot=this.getTableRoot(e);tableRoot&&this.clickHandlers.forEach((handler=>handler(tableRoot,e)))}.bind(this))}getTableRoot(e){const tableRoot=e.target.closest(Selectors.main.region);return tableRoot||!1}setPluginState(methodname,plugin,state){return(0,_ajax.call)([{methodname:methodname,args:{plugin:plugin,state:state}}])[0]}setPluginOrder(methodname,plugin,direction){return(0,_ajax.call)([{methodname:methodname,args:{plugin:plugin,direction:direction}}])[0]}async handleStateToggle(tableRoot,e){const stateToggle=e.target.closest('[data-action="togglestate"][data-toggle-method]');if(stateToggle){e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:togglestate");await this.setPluginState(stateToggle.dataset.toggleMethod,stateToggle.dataset.plugin,"1"===stateToggle.dataset.state?0:1);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]);updatedRoot.querySelector('[data-action="togglestate"][data-plugin="'.concat(stateToggle.dataset.plugin,'"]')).focus(),pendingPromise.resolve()}}async handleMoveUpDown(tableRoot,e){const actionLink=e.target.closest('[data-action="move"][data-method][data-direction]');if(!actionLink)return;e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:processAction");await this.setPluginOrder(actionLink.dataset.method,actionLink.dataset.plugin,"up"===actionLink.dataset.direction?-1:1);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]),exactMatch=updatedRoot.querySelector('[data-action="move"][data-plugin="'.concat(actionLink.dataset.plugin,'"][data-direction="').concat(actionLink.dataset.direction,'"]'));var _updatedRoot$querySel;exactMatch?exactMatch.focus():null===(_updatedRoot$querySel=updatedRoot.querySelector('[data-action="move"][data-plugin="'.concat(actionLink.dataset.plugin,'"]')))||void 0===_updatedRoot$querySel||_updatedRoot$querySel.focus();pendingPromise.resolve()}},_exports.default})); +define("core_admin/plugin_management_table",["exports","core_table/dynamic","core_table/local/dynamic/selectors","core/ajax","core/pending","core/notification"],(function(_exports,_dynamic,Selectors,_ajax,_pending,_notification){var obj;function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Selectors=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(Selectors),_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};let watching=!1;return _exports.default=class{constructor(){!function(obj,key,value){key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value}(this,"clickHandlers",[]),this.addClickHandler(this.handleStateToggle),this.addClickHandler(this.handleMoveUpDown),this.registerEventListeners()}static init(){watching||(watching=!0,new this)}addClickHandler(handler){this.clickHandlers.push(handler.bind(this))}registerEventListeners(){document.addEventListener("click",function(e){const tableRoot=this.getTableRoot(e);tableRoot&&this.clickHandlers.forEach((handler=>handler(tableRoot,e)))}.bind(this))}getTableRoot(e){const tableRoot=e.target.closest(Selectors.main.region);return tableRoot||!1}setPluginState(methodname,plugin,state){return(0,_ajax.call)([{methodname:methodname,args:{plugin:plugin,state:state}}])[0]}setPluginOrder(methodname,plugin,direction){return(0,_ajax.call)([{methodname:methodname,args:{plugin:plugin,direction:direction}}])[0]}async handleStateToggle(tableRoot,e){const stateToggle=e.target.closest('[data-action="togglestate"][data-toggle-method]');if(stateToggle){e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:togglestate");await this.setPluginState(stateToggle.dataset.toggleMethod,stateToggle.dataset.plugin,"1"===stateToggle.dataset.state?0:1);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]);updatedRoot.querySelector('[data-action="togglestate"][data-plugin="'.concat(stateToggle.dataset.plugin,'"]')).focus(),this.removeTooltips(),pendingPromise.resolve()}}async handleMoveUpDown(tableRoot,e){const actionLink=e.target.closest('[data-action="move"][data-method][data-direction]');if(!actionLink)return;e.preventDefault();const pendingPromise=new _pending.default("core_table/dynamic:processAction");await this.setPluginOrder(actionLink.dataset.method,actionLink.dataset.plugin,"up"===actionLink.dataset.direction?-1:1);const[updatedRoot]=await Promise.all([(0,_dynamic.refreshTableContent)(tableRoot),(0,_notification.fetchNotifications)()]),exactMatch=updatedRoot.querySelector('[data-action="move"][data-plugin="'.concat(actionLink.dataset.plugin,'"][data-direction="').concat(actionLink.dataset.direction,'"]'));var _updatedRoot$querySel;exactMatch?exactMatch.focus():null===(_updatedRoot$querySel=updatedRoot.querySelector('[data-action="move"][data-plugin="'.concat(actionLink.dataset.plugin,'"]')))||void 0===_updatedRoot$querySel||_updatedRoot$querySel.focus();pendingPromise.resolve()}removeTooltips(){const tooltips=document.querySelectorAll('[id*="tooltip"]');tooltips.length>0&&tooltips.forEach((tooltip=>{tooltip.remove()}))}},_exports.default})); //# sourceMappingURL=plugin_management_table.min.js.map \ No newline at end of file diff --git a/admin/amd/build/plugin_management_table.min.js.map b/admin/amd/build/plugin_management_table.min.js.map index 6cb58523111..86538f269bd 100644 --- a/admin/amd/build/plugin_management_table.min.js.map +++ b/admin/amd/build/plugin_management_table.min.js.map @@ -1 +1 @@ -{"version":3,"file":"plugin_management_table.min.js","sources":["../src/plugin_management_table.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 .\n\nimport {refreshTableContent} from 'core_table/dynamic';\nimport * as Selectors from 'core_table/local/dynamic/selectors';\nimport {call as fetchMany} from 'core/ajax';\nimport Pending from 'core/pending';\nimport {fetchNotifications} from 'core/notification';\n\nlet watching = false;\n\nexport default class {\n /**\n * @property {function[]} clickHandlers a list of handlers to call on click.\n */\n clickHandlers = [];\n\n constructor() {\n this.addClickHandler(this.handleStateToggle);\n this.addClickHandler(this.handleMoveUpDown);\n this.registerEventListeners();\n }\n\n /**\n * Initialise an instance of the class.\n *\n * This is just a way of making it easier to initialise an instance of the class from PHP.\n */\n static init() {\n if (watching) {\n return;\n }\n watching = true;\n new this();\n }\n\n /**\n * Add a click handler to the list of handlers.\n *\n * @param {Function} handler A handler to call on a click event\n */\n addClickHandler(handler) {\n this.clickHandlers.push(handler.bind(this));\n }\n\n /**\n * Register the event listeners for this instance.\n */\n registerEventListeners() {\n document.addEventListener('click', function(e) {\n const tableRoot = this.getTableRoot(e);\n\n if (!tableRoot) {\n return;\n }\n\n this.clickHandlers.forEach((handler) => handler(tableRoot, e));\n }.bind(this));\n }\n\n /**\n * Get the table root from an event.\n *\n * @param {Event} e\n * @returns {HTMLElement|bool}\n */\n getTableRoot(e) {\n const tableRoot = e.target.closest(Selectors.main.region);\n if (!tableRoot) {\n return false;\n }\n\n return tableRoot;\n }\n\n /**\n * Set the plugin state (enabled or disabled)\n *\n * @param {string} methodname The web service to call\n * @param {string} plugin The name of the plugin to set the state for\n * @param {number} state The state to set\n * @returns {Promise}\n */\n setPluginState(methodname, plugin, state) {\n return fetchMany([{\n methodname,\n args: {\n plugin,\n state,\n },\n }])[0];\n }\n\n setPluginOrder(methodname, plugin, direction) {\n return fetchMany([{\n methodname,\n args: {\n plugin,\n direction,\n },\n }])[0];\n }\n\n /**\n * Handle state toggling.\n *\n * @param {HTMLElement} tableRoot\n * @param {Event} e\n */\n async handleStateToggle(tableRoot, e) {\n const stateToggle = e.target.closest('[data-action=\"togglestate\"][data-toggle-method]');\n if (stateToggle) {\n e.preventDefault();\n const pendingPromise = new Pending('core_table/dynamic:togglestate');\n\n await this.setPluginState(\n stateToggle.dataset.toggleMethod,\n stateToggle.dataset.plugin,\n stateToggle.dataset.state === '1' ? 0 : 1\n );\n\n const [updatedRoot] = await Promise.all([\n refreshTableContent(tableRoot),\n fetchNotifications(),\n ]);\n\n // Refocus on the link that as pressed in the first place.\n updatedRoot.querySelector(`[data-action=\"togglestate\"][data-plugin=\"${stateToggle.dataset.plugin}\"]`).focus();\n pendingPromise.resolve();\n }\n }\n\n async handleMoveUpDown(tableRoot, e) {\n const actionLink = e.target.closest('[data-action=\"move\"][data-method][data-direction]');\n if (!actionLink) {\n return;\n }\n\n e.preventDefault();\n\n const pendingPromise = new Pending('core_table/dynamic:processAction');\n\n await this.setPluginOrder(\n actionLink.dataset.method,\n actionLink.dataset.plugin,\n actionLink.dataset.direction === 'up' ? -1 : 1,\n );\n\n const [updatedRoot] = await Promise.all([\n refreshTableContent(tableRoot),\n fetchNotifications(),\n ]);\n\n // Refocus on the link that as pressed in the first place.\n const exactMatch = updatedRoot.querySelector(\n `[data-action=\"move\"][data-plugin=\"${actionLink.dataset.plugin}\"][data-direction=\"${actionLink.dataset.direction}\"]`\n );\n if (exactMatch) {\n exactMatch.focus();\n } else {\n // The move link is not present anymore, so we need to focus on the other one.\n updatedRoot.querySelector(`[data-action=\"move\"][data-plugin=\"${actionLink.dataset.plugin}\"]`)?.focus();\n }\n\n pendingPromise.resolve();\n }\n}\n"],"names":["watching","constructor","addClickHandler","this","handleStateToggle","handleMoveUpDown","registerEventListeners","handler","clickHandlers","push","bind","document","addEventListener","e","tableRoot","getTableRoot","forEach","target","closest","Selectors","main","region","setPluginState","methodname","plugin","state","args","setPluginOrder","direction","stateToggle","preventDefault","pendingPromise","Pending","dataset","toggleMethod","updatedRoot","Promise","all","querySelector","focus","resolve","actionLink","method","exactMatch"],"mappings":"gzCAqBIA,UAAW,gCAQXC,8KAFgB,SAGPC,gBAAgBC,KAAKC,wBACrBF,gBAAgBC,KAAKE,uBACrBC,uCASDN,WAGJA,UAAW,MACPG,MAQRD,gBAAgBK,cACPC,cAAcC,KAAKF,QAAQG,KAAKP,OAMzCG,yBACIK,SAASC,iBAAiB,QAAS,SAASC,SAClCC,UAAYX,KAAKY,aAAaF,GAE/BC,gBAIAN,cAAcQ,SAAST,SAAYA,QAAQO,UAAWD,MAC7DH,KAAKP,OASXY,aAAaF,SACHC,UAAYD,EAAEI,OAAOC,QAAQC,UAAUC,KAAKC,eAC7CP,YACM,EAcfQ,eAAeC,WAAYC,OAAQC,cACxB,cAAU,CAAC,CACdF,WAAAA,WACAG,KAAM,CACFF,OAAAA,OACAC,MAAAA,UAEJ,GAGRE,eAAeJ,WAAYC,OAAQI,kBACxB,cAAU,CAAC,CACdL,WAAAA,WACAG,KAAM,CACFF,OAAAA,OACAI,UAAAA,cAEJ,2BASgBd,UAAWD,SACzBgB,YAAchB,EAAEI,OAAOC,QAAQ,sDACjCW,YAAa,CACbhB,EAAEiB,uBACIC,eAAiB,IAAIC,iBAAQ,wCAE7B7B,KAAKmB,eACPO,YAAYI,QAAQC,aACpBL,YAAYI,QAAQT,OACU,MAA9BK,YAAYI,QAAQR,MAAgB,EAAI,SAGrCU,mBAAqBC,QAAQC,IAAI,EACpC,gCAAoBvB,YACpB,wCAIJqB,YAAYG,iEAA0DT,YAAYI,QAAQT,cAAYe,QACtGR,eAAeS,kCAIA1B,UAAWD,SACxB4B,WAAa5B,EAAEI,OAAOC,QAAQ,yDAC/BuB,kBAIL5B,EAAEiB,uBAEIC,eAAiB,IAAIC,iBAAQ,0CAE7B7B,KAAKwB,eACPc,WAAWR,QAAQS,OACnBD,WAAWR,QAAQT,OACc,OAAjCiB,WAAWR,QAAQL,WAAsB,EAAI,SAG1CO,mBAAqBC,QAAQC,IAAI,EACpC,gCAAoBvB,YACpB,wCAIE6B,WAAaR,YAAYG,0DACUG,WAAWR,QAAQT,qCAA4BiB,WAAWR,QAAQL,2CAEvGe,WACAA,WAAWJ,sCAGXJ,YAAYG,0DAAmDG,WAAWR,QAAQT,sEAAae,QAGnGR,eAAeS"} \ No newline at end of file +{"version":3,"file":"plugin_management_table.min.js","sources":["../src/plugin_management_table.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 .\n\nimport {refreshTableContent} from 'core_table/dynamic';\nimport * as Selectors from 'core_table/local/dynamic/selectors';\nimport {call as fetchMany} from 'core/ajax';\nimport Pending from 'core/pending';\nimport {fetchNotifications} from 'core/notification';\n\nlet watching = false;\n\nexport default class {\n /**\n * @property {function[]} clickHandlers a list of handlers to call on click.\n */\n clickHandlers = [];\n\n constructor() {\n this.addClickHandler(this.handleStateToggle);\n this.addClickHandler(this.handleMoveUpDown);\n this.registerEventListeners();\n }\n\n /**\n * Initialise an instance of the class.\n *\n * This is just a way of making it easier to initialise an instance of the class from PHP.\n */\n static init() {\n if (watching) {\n return;\n }\n watching = true;\n new this();\n }\n\n /**\n * Add a click handler to the list of handlers.\n *\n * @param {Function} handler A handler to call on a click event\n */\n addClickHandler(handler) {\n this.clickHandlers.push(handler.bind(this));\n }\n\n /**\n * Register the event listeners for this instance.\n */\n registerEventListeners() {\n document.addEventListener('click', function(e) {\n const tableRoot = this.getTableRoot(e);\n\n if (!tableRoot) {\n return;\n }\n\n this.clickHandlers.forEach((handler) => handler(tableRoot, e));\n }.bind(this));\n }\n\n /**\n * Get the table root from an event.\n *\n * @param {Event} e\n * @returns {HTMLElement|bool}\n */\n getTableRoot(e) {\n const tableRoot = e.target.closest(Selectors.main.region);\n if (!tableRoot) {\n return false;\n }\n\n return tableRoot;\n }\n\n /**\n * Set the plugin state (enabled or disabled)\n *\n * @param {string} methodname The web service to call\n * @param {string} plugin The name of the plugin to set the state for\n * @param {number} state The state to set\n * @returns {Promise}\n */\n setPluginState(methodname, plugin, state) {\n return fetchMany([{\n methodname,\n args: {\n plugin,\n state,\n },\n }])[0];\n }\n\n setPluginOrder(methodname, plugin, direction) {\n return fetchMany([{\n methodname,\n args: {\n plugin,\n direction,\n },\n }])[0];\n }\n\n /**\n * Handle state toggling.\n *\n * @param {HTMLElement} tableRoot\n * @param {Event} e\n */\n async handleStateToggle(tableRoot, e) {\n const stateToggle = e.target.closest('[data-action=\"togglestate\"][data-toggle-method]');\n if (stateToggle) {\n e.preventDefault();\n const pendingPromise = new Pending('core_table/dynamic:togglestate');\n\n await this.setPluginState(\n stateToggle.dataset.toggleMethod,\n stateToggle.dataset.plugin,\n stateToggle.dataset.state === '1' ? 0 : 1\n );\n\n const [updatedRoot] = await Promise.all([\n refreshTableContent(tableRoot),\n fetchNotifications(),\n ]);\n\n // Refocus on the link that as pressed in the first place.\n updatedRoot.querySelector(`[data-action=\"togglestate\"][data-plugin=\"${stateToggle.dataset.plugin}\"]`).focus();\n\n // When clicking the toggle and it remains focused, a new tooltip will be generated.\n // Therefore, the old tooltip should be removed.\n this.removeTooltips();\n pendingPromise.resolve();\n }\n }\n\n async handleMoveUpDown(tableRoot, e) {\n const actionLink = e.target.closest('[data-action=\"move\"][data-method][data-direction]');\n if (!actionLink) {\n return;\n }\n\n e.preventDefault();\n\n const pendingPromise = new Pending('core_table/dynamic:processAction');\n\n await this.setPluginOrder(\n actionLink.dataset.method,\n actionLink.dataset.plugin,\n actionLink.dataset.direction === 'up' ? -1 : 1,\n );\n\n const [updatedRoot] = await Promise.all([\n refreshTableContent(tableRoot),\n fetchNotifications(),\n ]);\n\n // Refocus on the link that as pressed in the first place.\n const exactMatch = updatedRoot.querySelector(\n `[data-action=\"move\"][data-plugin=\"${actionLink.dataset.plugin}\"][data-direction=\"${actionLink.dataset.direction}\"]`\n );\n if (exactMatch) {\n exactMatch.focus();\n } else {\n // The move link is not present anymore, so we need to focus on the other one.\n updatedRoot.querySelector(`[data-action=\"move\"][data-plugin=\"${actionLink.dataset.plugin}\"]`)?.focus();\n }\n\n pendingPromise.resolve();\n }\n\n /**\n * Remove tooltips.\n */\n removeTooltips() {\n const tooltips = document.querySelectorAll('[id*=\"tooltip\"]');\n if (tooltips.length > 0) {\n tooltips.forEach(tooltip => {\n tooltip.remove();\n });\n }\n }\n}\n"],"names":["watching","constructor","addClickHandler","this","handleStateToggle","handleMoveUpDown","registerEventListeners","handler","clickHandlers","push","bind","document","addEventListener","e","tableRoot","getTableRoot","forEach","target","closest","Selectors","main","region","setPluginState","methodname","plugin","state","args","setPluginOrder","direction","stateToggle","preventDefault","pendingPromise","Pending","dataset","toggleMethod","updatedRoot","Promise","all","querySelector","focus","removeTooltips","resolve","actionLink","method","exactMatch","tooltips","querySelectorAll","length","tooltip","remove"],"mappings":"gzCAqBIA,UAAW,gCAQXC,8KAFgB,SAGPC,gBAAgBC,KAAKC,wBACrBF,gBAAgBC,KAAKE,uBACrBC,uCASDN,WAGJA,UAAW,MACPG,MAQRD,gBAAgBK,cACPC,cAAcC,KAAKF,QAAQG,KAAKP,OAMzCG,yBACIK,SAASC,iBAAiB,QAAS,SAASC,SAClCC,UAAYX,KAAKY,aAAaF,GAE/BC,gBAIAN,cAAcQ,SAAST,SAAYA,QAAQO,UAAWD,MAC7DH,KAAKP,OASXY,aAAaF,SACHC,UAAYD,EAAEI,OAAOC,QAAQC,UAAUC,KAAKC,eAC7CP,YACM,EAcfQ,eAAeC,WAAYC,OAAQC,cACxB,cAAU,CAAC,CACdF,WAAAA,WACAG,KAAM,CACFF,OAAAA,OACAC,MAAAA,UAEJ,GAGRE,eAAeJ,WAAYC,OAAQI,kBACxB,cAAU,CAAC,CACdL,WAAAA,WACAG,KAAM,CACFF,OAAAA,OACAI,UAAAA,cAEJ,2BASgBd,UAAWD,SACzBgB,YAAchB,EAAEI,OAAOC,QAAQ,sDACjCW,YAAa,CACbhB,EAAEiB,uBACIC,eAAiB,IAAIC,iBAAQ,wCAE7B7B,KAAKmB,eACPO,YAAYI,QAAQC,aACpBL,YAAYI,QAAQT,OACU,MAA9BK,YAAYI,QAAQR,MAAgB,EAAI,SAGrCU,mBAAqBC,QAAQC,IAAI,EACpC,gCAAoBvB,YACpB,wCAIJqB,YAAYG,iEAA0DT,YAAYI,QAAQT,cAAYe,aAIjGC,iBACLT,eAAeU,kCAIA3B,UAAWD,SACxB6B,WAAa7B,EAAEI,OAAOC,QAAQ,yDAC/BwB,kBAIL7B,EAAEiB,uBAEIC,eAAiB,IAAIC,iBAAQ,0CAE7B7B,KAAKwB,eACPe,WAAWT,QAAQU,OACnBD,WAAWT,QAAQT,OACc,OAAjCkB,WAAWT,QAAQL,WAAsB,EAAI,SAG1CO,mBAAqBC,QAAQC,IAAI,EACpC,gCAAoBvB,YACpB,wCAIE8B,WAAaT,YAAYG,0DACUI,WAAWT,QAAQT,qCAA4BkB,WAAWT,QAAQL,2CAEvGgB,WACAA,WAAWL,sCAGXJ,YAAYG,0DAAmDI,WAAWT,QAAQT,sEAAae,QAGnGR,eAAeU,UAMnBD,uBACUK,SAAWlC,SAASmC,iBAAiB,mBACvCD,SAASE,OAAS,GAClBF,SAAS7B,SAAQgC,UACbA,QAAQC"} \ No newline at end of file diff --git a/admin/amd/src/plugin_management_table.js b/admin/amd/src/plugin_management_table.js index 6a6644b98bf..0a4f87b6309 100644 --- a/admin/amd/src/plugin_management_table.js +++ b/admin/amd/src/plugin_management_table.js @@ -138,6 +138,10 @@ export default class { // Refocus on the link that as pressed in the first place. updatedRoot.querySelector(`[data-action="togglestate"][data-plugin="${stateToggle.dataset.plugin}"]`).focus(); + + // When clicking the toggle and it remains focused, a new tooltip will be generated. + // Therefore, the old tooltip should be removed. + this.removeTooltips(); pendingPromise.resolve(); } } @@ -176,4 +180,16 @@ export default class { pendingPromise.resolve(); } + + /** + * Remove tooltips. + */ + removeTooltips() { + const tooltips = document.querySelectorAll('[id*="tooltip"]'); + if (tooltips.length > 0) { + tooltips.forEach(tooltip => { + tooltip.remove(); + }); + } + } }