mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
3 lines
1.9 KiB
JavaScript
3 lines
1.9 KiB
JavaScript
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/drawer",["exports","jquery","core/pubsub","core/aria","core/drawer_events"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=h(b);c=g(c);d=g(d);e=h(e);function f(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;f=function(){return a};return a}function g(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=f();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var g=d?Object.getOwnPropertyDescriptor(a,e):null;if(g&&(g.get||g.set)){Object.defineProperty(c,e,g)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function h(a){return a&&a.__esModule?a:{default:a}}var i=function(a){a=(0,b.default)(a);d.unhide(a.get());a.removeClass("hidden");a.attr("aria-expanded",!0);a.focus();c.publish(e.default.DRAWER_SHOWN,a)},j=function(a){a=(0,b.default)(a);a.addClass("hidden");a.attr("aria-expanded",!1);d.hide(a.get());c.publish(e.default.DRAWER_HIDDEN,a)},k=function(a){var b=a.hasClass("hidden");return!b},l=function(a){if(k(a)){j(a)}else{i(a)}},m=function(a){a=(0,b.default)(a);return a.closest("[data-region=\"right-hand-drawer\"]")};a.default={hide:j,show:i,isVisible:k,toggle:l,registerToggles:function registerToggles(a,b){var c=null;b.attr("aria-expanded",k(a));b.on("click",function(d){d.preventDefault();var e=k(a);l(a);b.attr("aria-expanded",!e);if(!e){c=b.filter(function(a,b){return b==d.target||b.contains(d.target)})}else if(c){c.focus();c=null}})},getDrawerRoot:m};return a.default});
|
|
//# sourceMappingURL=drawer.min.js.map
|