mirror of https://github.com/ColorlibHQ/AdminLTE
273 lines
7.5 KiB
JavaScript
273 lines
7.5 KiB
JavaScript
![]() |
/*!
|
||
|
* AdminLTE v3.0.0-alpha (https://almsaeedstudio.com)
|
||
|
* Copyright 2014-2015 Abdullah Almsaeed <abdullah@almsaeedstudio.com>
|
||
|
* Project website Almsaeed Studio (https://almsaeedstudio.com)
|
||
|
* Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE)
|
||
|
*/
|
||
|
'use strict';
|
||
|
|
||
|
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||
|
|
||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||
|
|
||
|
/**
|
||
|
* --------------------------------------------
|
||
|
* AdminLTE Treeview.js
|
||
|
* License MIT
|
||
|
* --------------------------------------------
|
||
|
*/
|
||
|
|
||
|
var Treeview = (function ($) {
|
||
|
|
||
|
/**
|
||
|
* Constants
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
var NAME = 'Treeview';
|
||
|
var DATA_KEY = 'lte.treeview';
|
||
|
var EVENT_KEY = '.' + DATA_KEY;
|
||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||
|
|
||
|
var EVENT = {
|
||
|
SELECTED: 'selected' + EVENT_KEY
|
||
|
};
|
||
|
|
||
|
var Selector = {
|
||
|
LI: '.nav-item',
|
||
|
LINK: '.nav-link',
|
||
|
DATA_WIDGET: '[data-widget="treeview"]'
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Class Definition
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
var Treeview = (function () {
|
||
|
function Treeview(element, config) {
|
||
|
_classCallCheck(this, Treeview);
|
||
|
|
||
|
this._config = config;
|
||
|
this._element = element;
|
||
|
}
|
||
|
|
||
|
// Public
|
||
|
|
||
|
// Private
|
||
|
|
||
|
// Static
|
||
|
|
||
|
_createClass(Treeview, null, [{
|
||
|
key: '_jQueryInterface',
|
||
|
value: function _jQueryInterface(config) {
|
||
|
return this.each(function () {
|
||
|
this._config = config;
|
||
|
});
|
||
|
}
|
||
|
}]);
|
||
|
|
||
|
return Treeview;
|
||
|
})();
|
||
|
|
||
|
/**
|
||
|
* jQuery API
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
$.fn[NAME] = Treeview._jQueryInterface;
|
||
|
$.fn[NAME].Constructor = Treeview;
|
||
|
$.fn[NAME].noConflict = function () {
|
||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||
|
return Treeview._jQueryInterface;
|
||
|
};
|
||
|
|
||
|
return Treeview;
|
||
|
})(jQuery);
|
||
|
//# sourceMappingURL=Treeview.js.map
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||
|
|
||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||
|
|
||
|
/**
|
||
|
* --------------------------------------------
|
||
|
* AdminLTE PushMenu.js
|
||
|
* License MIT
|
||
|
* --------------------------------------------
|
||
|
*/
|
||
|
|
||
|
var PushMenu = (function ($) {
|
||
|
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Constants
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
var NAME = 'PushMenu';
|
||
|
var DATA_KEY = 'lte.pushmenu';
|
||
|
var EVENT_KEY = '.' + DATA_KEY;
|
||
|
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||
|
|
||
|
var Event = {
|
||
|
COLLAPSED: 'collapsed' + EVENT_KEY,
|
||
|
SHOWN: 'shown' + DATA_KEY
|
||
|
};
|
||
|
|
||
|
var Selector = {
|
||
|
COLLAPSED: 'sidebar-collapse',
|
||
|
TOGGLE_BUTTON: '[data-widget="pushmenu"]'
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Class Definition
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
var PushMenu = (function () {
|
||
|
function PushMenu() {
|
||
|
_classCallCheck(this, PushMenu);
|
||
|
}
|
||
|
|
||
|
_createClass(PushMenu, [{
|
||
|
key: 'Constructor',
|
||
|
value: function Constructor(element) {
|
||
|
this._element = element;
|
||
|
this._isShown;
|
||
|
}
|
||
|
|
||
|
// Public
|
||
|
|
||
|
}, {
|
||
|
key: 'show',
|
||
|
value: function show() {
|
||
|
$('body').removeClass(Selector.COLLAPSED);
|
||
|
this._isShown = true;
|
||
|
|
||
|
var shownEvent = $.Event(Event.SHOWN);
|
||
|
$(this._element).trigger(shownEvent);
|
||
|
}
|
||
|
}, {
|
||
|
key: 'collapse',
|
||
|
value: function collapse() {
|
||
|
$('body').addClass(Selector.COLLAPSED);
|
||
|
this._isShown = false;
|
||
|
|
||
|
var collapsedEvent = $.Event(Event.COLLAPSED);
|
||
|
$(this._element).trigger(collapsedEvent);
|
||
|
}
|
||
|
}, {
|
||
|
key: 'toggle',
|
||
|
value: function toggle() {
|
||
|
|
||
|
if (typeof this._isShown === 'undefined') {
|
||
|
this._isShown = !$('body').hasClass(Selector.COLLAPSED);
|
||
|
}
|
||
|
|
||
|
if (this._isShown) {
|
||
|
this.collapse();
|
||
|
} else {
|
||
|
this.show();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Static
|
||
|
|
||
|
}], [{
|
||
|
key: '_jQueryInterface',
|
||
|
value: function _jQueryInterface(operation) {
|
||
|
return this.each(function () {
|
||
|
var data = $(this).data(DATA_KEY);
|
||
|
|
||
|
if (!data) {
|
||
|
data = new PushMenu(this);
|
||
|
$(this).data(DATA_KEY, data);
|
||
|
}
|
||
|
|
||
|
if (operation) {
|
||
|
data[operation]();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}]);
|
||
|
|
||
|
return PushMenu;
|
||
|
})();
|
||
|
|
||
|
/**
|
||
|
* Data API
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
$(document).on('click', Selector.TOGGLE_BUTTON, function (event) {
|
||
|
event.preventDefault();
|
||
|
|
||
|
var button = event.target;
|
||
|
|
||
|
if ($(button).data('widget') !== 'pushmenu') {
|
||
|
button = $(button).closest(Selector.TOGGLE_BUTTON);
|
||
|
}
|
||
|
|
||
|
PushMenu._jQueryInterface.call($(button), 'toggle');
|
||
|
});
|
||
|
|
||
|
/**
|
||
|
* jQuery API
|
||
|
* ====================================================
|
||
|
*/
|
||
|
|
||
|
$.fn[NAME] = PushMenu._jQueryInterface;
|
||
|
$.fn[NAME].Constructor = PushMenu;
|
||
|
$.fn[NAME].noConflict = function () {
|
||
|
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||
|
return PushMenu._jQueryInterface;
|
||
|
};
|
||
|
|
||
|
return PushMenu;
|
||
|
})(jQuery);
|
||
|
//# sourceMappingURL=PushMenu.js.map
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||
|
|
||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||
|
|
||
|
/**
|
||
|
* --------------------------------------------
|
||
|
* AdminLTE Widget.js
|
||
|
* License MIT
|
||
|
* --------------------------------------------
|
||
|
*/
|
||
|
|
||
|
var Widget = (function ($) {
|
||
|
'use strict';
|
||
|
|
||
|
var Widget = (function () {
|
||
|
function Widget() {
|
||
|
_classCallCheck(this, Widget);
|
||
|
}
|
||
|
|
||
|
_createClass(Widget, [{
|
||
|
key: 'Constructor',
|
||
|
value: function Constructor(element) {
|
||
|
this._element = element;
|
||
|
}
|
||
|
}], [{
|
||
|
key: '_jQueryInterface',
|
||
|
value: function _jQueryInterface(element) {
|
||
|
var $this = $(element);
|
||
|
$this.show();
|
||
|
}
|
||
|
}]);
|
||
|
|
||
|
return Widget;
|
||
|
})();
|
||
|
|
||
|
return Widget;
|
||
|
})(jQuery);
|
||
|
//# sourceMappingURL=Widget.js.map
|