AdminLTE/dist/js/adminlte.js.map

1 line
70 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"adminlte.js","sources":["../../build/js/ControlSidebar.js","../../build/js/Layout.js","../../build/js/PushMenu.js","../../build/js/Treeview.js","../../build/js/DirectChat.js","../../build/js/TodoList.js","../../build/js/CardWidget.js","../../build/js/CardRefresh.js"],"sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE ControlSidebar.js\n * License MIT\n * --------------------------------------------\n */\n\nconst ControlSidebar = (($) => {\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'ControlSidebar'\n const DATA_KEY = 'lte.controlsidebar'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const DATA_API_KEY = '.data-api'\n\n const Event = {\n COLLAPSED: `collapsed${EVENT_KEY}`,\n EXPANDED: `expanded${EVENT_KEY}`\n }\n\n const Selector = {\n CONTROL_SIDEBAR: '.control-sidebar',\n DATA_TOGGLE : '[data-widget=\"control-sidebar\"]',\n MAIN_HEADER : '.main-header'\n }\n\n const ClassName = {\n CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',\n CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',\n CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open'\n }\n\n const Default = {\n controlsidebarSlide: true\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class ControlSidebar {\n constructor(element, config) {\n this._element = element\n this._config = this._getConfig(config)\n }\n\n // Public\n\n show() {\n // Show the control sidebar\n if (this._config.controlsidebarSlide) {\n $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)\n $('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function(){\n $(Selector.CONTROL_SIDEBAR).hide()\n $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)\n $(this).dequeue()\n })\n } else {\n $('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)\n }\n\n const expandedEvent = $.Event(Event.EXPANDED)\n $(this._element).trigger(expandedEvent)\n }\n\n collapse() {\n // Collapse the control sidebar\n if (this._config.controlsidebarSlide) {\n $('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)\n $(Selector.CONTROL_SIDEBAR).show().delay(10).queue(function(){\n $('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function(){\n $('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)\n $(this).dequeue()\n })\n $(this).dequeue()\n })\n } else {\n $('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)\n }\n\n const collapsedEvent = $.Event(Event.COLLAPSED)\n $(this._element).trigger(collapsedEvent)\n }\n\n toggle() {\n const shouldOpen = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body')\n .hasClass(ClassName.CONTROL_SIDEBAR_SLIDE)\n if (shouldOpen) {\n // Open the control sidebar\n this.show()\n } else {\n // Close the control sidebar\n this.collapse()\n }\n }\n\n // Private\n\n _getConfig(config) {\n return $.extend({}, Default, config)\n }\n\n // Static\n\n static _jQueryInterface(operation) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new ControlSidebar(this, $(this).data())\n $(this).data(DATA_KEY, data)\n }\n\n if (data[operation] === 'undefined') {\n throw new Error(`${operation} is not a function`)\n }\n\n data[operation]()\n })\n }\n }\n\n /**\n *\n * Data Api implementation\n * ====================================================\n */\n $(document).on('click', Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n\n ControlSidebar._jQueryInterface.call($(this), 'toggle')\n })\n\n /**\n * jQuery API\n * ======