You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdminLTE/dist/js/adminlte.js

1119 lines
30 KiB

/*!
* AdminLTE v3.0.0-beta.2 (https://adminlte.io)
* Copyright 2014-2019 Colorlib <http://colorlib.com>
* Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE)
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.adminlte = {}));
}(this, function (exports) { 'use strict';
/**
* --------------------------------------------
* AdminLTE ControlSidebar.js
* License MIT
* --------------------------------------------
*/
var ControlSidebar = function ($) {
/**
* Constants
* ====================================================
*/
var NAME = 'ControlSidebar';
var DATA_KEY = 'lte.control.sidebar';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var Selector = {
CONTROL_SIDEBAR: '.control-sidebar',
DATA_TOGGLE: '[data-widget="control-sidebar"]',
MAIN_HEADER: '.main-header'
};
var ClassName = {
CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open'
};
var Default = {
slide: true
/**
* Class Definition
* ====================================================
*/
};
var ControlSidebar =
/*#__PURE__*/
function () {
function ControlSidebar(element, config) {
this._element = element;
this._config = this._getConfig(config);
} // Public
var _proto = ControlSidebar.prototype;
_proto.show = function show() {
// Show the control sidebar
if (this._config.slide) {
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
$('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
$(Selector.CONTROL_SIDEBAR).hide();
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
$(this).dequeue();
});
} else {
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN);
}
};
_proto.collapse = function collapse() {
// Collapse the control sidebar
if (this._config.slide) {
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
$(Selector.CONTROL_SIDEBAR).show().delay(100).queue(function () {
$('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
$(this).dequeue();
});
$(this).dequeue();
});
} else {
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN);
}
};
_proto.toggle = function toggle() {
this._setMargin();
var shouldOpen = $('body').hasClass(ClassName.CONTROL_SIDEBAR_OPEN) || $('body').hasClass(ClassName.CONTROL_SIDEBAR_SLIDE);
if (shouldOpen) {
// Open the control sidebar
this.show();
} else {
// Close the control sidebar
this.collapse();
}
} // Private
;
_proto._getConfig = function _getConfig(config) {
return $.extend({}, Default, config);
};
_proto._setMargin = function _setMargin() {
$(Selector.CONTROL_SIDEBAR).css({
top: $(Selector.MAIN_HEADER).innerHeight()
});
} // Static
;
ControlSidebar._jQueryInterface = function _jQueryInterface(operation) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
if (!data) {
data = new ControlSidebar(this, $(this).data());
$(this).data(DATA_KEY, data);
}
if (data[operation] === 'undefined') {
throw new Error(operation + " is not a function");
}
data[operation]();
});
};
return ControlSidebar;
}();
/**
*
* Data Api implementation
* ====================================================
*/
$(document).on('click', Selector.DATA_TOGGLE, function (event) {
event.preventDefault();
ControlSidebar._jQueryInterface.call($(this), 'toggle');
});
/**
* jQuery API
* ====================================================
*/
$.fn[NAME] = ControlSidebar._jQueryInterface;
$.fn[NAME].Constructor = ControlSidebar;
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return ControlSidebar._jQueryInterface;
};
return ControlSidebar;
}(jQuery);
/**
* --------------------------------------------
* AdminLTE Layout.js
* License MIT
* --------------------------------------------
*/
var Layout = function ($) {
/**
* Constants
* ====================================================
*/
var NAME = 'Layout';
var DATA_KEY = 'lte.layout';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var Selector = {
HEADER: '.main-header',
MAIN_SIDEBAR: '.main-sidebar',
SIDEBAR: '.main-sidebar .sidebar',
CONTENT: '.content-wrapper',
BRAND: '.brand-link',
CONTENT_HEADER: '.content-header',
WRAPPER: '.wrapper',
CONTROL_SIDEBAR: '.control-sidebar',
LAYOUT_FIXED: '.layout-fixed',
FOOTER: '.main-footer'
};
var ClassName = {
HOLD: 'hold-transition',
SIDEBAR: 'main-sidebar',
CONTENT_FIXED: 'content-fixed',
SIDEBAR_FOCUSED: 'sidebar-focused',
LAYOUT_FIXED: 'layout-fixed',
NAVBAR_FIXED: 'layout-navbar-fixed',
FOOTER_FIXED: 'layout-footer-fixed'
};
var Default = {
scrollbarTheme: 'os-theme-light',
scrollbarAutoHide: 'l'
/**
* Class Definition
* ====================================================
*/
};
var Layout =
/*#__PURE__*/
function () {
function Layout(element, config) {
this._config = config;
this._element = element;
this._init();
} // Public
var _proto = Layout.prototype;
_proto.fixLayoutHeight = function fixLayoutHeight() {
var heights = {
window: $(window).height(),
header: $(Selector.HEADER).outerHeight(),
footer: $(Selector.FOOTER).outerHeight(),
sidebar: $(Selector.SIDEBAR).height()
};
var max = this._max(heights);
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
$(Selector.CONTENT).css('min-height', max - heights.header - heights.footer); // $(Selector.SIDEBAR).css('min-height', max - heights.header)
$(Selector.CONTROL_SIDEBAR + ' .control-sidebar-content').css('height', max - heights.header);
if (typeof $.fn.overlayScrollbars !== 'undefined') {
$(Selector.SIDEBAR).overlayScrollbars({
className: this._config.scrollbarTheme,
sizeAutoCapable: true,
scrollbars: {
autoHide: this._config.scrollbarAutoHide,
clickScrolling: true
}
});
$(Selector.CONTROL_SIDEBAR + ' .control-sidebar-content').overlayScrollbars({
className: this._config.scrollbarTheme,
sizeAutoCapable: true,
scrollbars: {
autoHide: this._config.scrollbarAutoHide,
clickScrolling: true
}
});
}
} else {
if (heights.window > heights.sidebar) {
$(Selector.CONTENT).css('min-height', heights.window - heights.header - heights.footer);
} else {
$(Selector.CONTENT).css('min-height', heights.sidebar - heights.header);
}
}
} // Private
;
_proto._init = function _init() {
var _this = this;
// Enable transitions
$('body').removeClass(ClassName.HOLD); // Activate layout height watcher
this.fixLayoutHeight();
$(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', function () {
_this.fixLayoutHeight();
});
$(window).resize(function () {
_this.fixLayoutHeight();
});
$('body, html').css('height', 'auto');
};
_proto._max = function _max(numbers) {
// Calculate the maximum number in a list
var max = 0;
Object.keys(numbers).forEach(function (key) {
if (numbers[key] > max) {
max = numbers[key];
}
});
return max;
} // Static
;
Layout._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = $.extend({}, Default, $(this).data());
if (!data) {
data = new Layout($(this), _config);
$(this).data(DATA_KEY, data);
}
if (config === 'init') {
data[config]();
}
});
};
return Layout;
}();
/**
* Data API
* ====================================================
*/
$(window).on('load', function () {
Layout._jQueryInterface.call($('body'));
});
$(Selector.SIDEBAR + ' a').on('focusin', function () {
$(Selector.MAIN_SIDEBAR).addClass(ClassName.SIDEBAR_FOCUSED);
});
$(Selector.SIDEBAR + ' a').on('focusout', function () {
$(Selector.MAIN_SIDEBAR).removeClass(ClassName.SIDEBAR_FOCUSED);
});
/**
* jQuery API
* ====================================================
*/
$.fn[NAME] = Layout._jQueryInterface;
$.fn[NAME].Constructor = Layout;
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Layout._jQueryInterface;
};
return Layout;
}(jQuery);
/**
* --------------------------------------------
* AdminLTE PushMenu.js
* License MIT
* --------------------------------------------
*/
var PushMenu = function ($) {
/**
* 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" + EVENT_KEY
};
var Default = {
autoCollapseSize: false,
screenCollapseSize: 768
};
var Selector = {
TOGGLE_BUTTON: '[data-widget="pushmenu"]',
SIDEBAR_MINI: '.sidebar-mini',
SIDEBAR_COLLAPSED: '.sidebar-collapse',
BODY: 'body',
OVERLAY: '#sidebar-overlay',
WRAPPER: '.wrapper'
};
var ClassName = {
SIDEBAR_OPEN: 'sidebar-open',
COLLAPSED: 'sidebar-collapse',
OPEN: 'sidebar-open',
SIDEBAR_MINI: 'sidebar-mini'
/**
* Class Definition
* ====================================================
*/
};
var PushMenu =
/*#__PURE__*/
function () {
function PushMenu(element, options) {
this._element = element;
this._options = $.extend({}, Default, options);
this._init();
if (!$(Selector.OVERLAY).length) {
this._addOverlay();
}
} // Public
var _proto = PushMenu.prototype;
_proto.show = function show() {
$(Selector.BODY).addClass(ClassName.OPEN).removeClass(ClassName.COLLAPSED);
var shownEvent = $.Event(Event.SHOWN);
$(this._element).trigger(shownEvent);
};
_proto.collapse = function collapse() {
$(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.COLLAPSED);
var collapsedEvent = $.Event(Event.COLLAPSED);
$(this._element).trigger(collapsedEvent);
};
_proto.isShown = function isShown() {
if ($(window).width() >= this._options.screenCollapseSize) {
return !$(Selector.BODY).hasClass(ClassName.COLLAPSED);
} else {
return $(Selector.BODY).hasClass(ClassName.OPEN);
}
};
_proto.toggle = function toggle() {
if (this.isShown()) {
this.collapse();
} else {
this.show();
}
};
_proto.autoCollapse = function autoCollapse() {
if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) {
if (this.isShown()) {
this.toggle();
}
} else {
if (!this.isShown()) {
this.toggle();
}
}
}
} // Private
;
_proto._init = function _init() {
var _this = this;
this.autoCollapse();
$(window).resize(function () {
_this.autoCollapse();
});
};
_proto._addOverlay = function _addOverlay() {
var _this2 = this;
var overlay = $('<div />', {
id: 'sidebar-overlay'
});
overlay.on('click', function () {
_this2.collapse();
});
$(Selector.WRAPPER).append(overlay);
} // Static
;
PushMenu._jQueryInterface = function _jQueryInterface(operation) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _options = $.extend({}, Default, $(this).data());
if (!data) {
data = new PushMenu(this, _options);
$(this).data(DATA_KEY, data);
}
if (operation === 'toggle') {
data[operation]();
}
});
};
return PushMenu;
}();
/**
* Data API
* ====================================================
*/
$(document).on('click', Selector.TOGGLE_BUTTON, function (event) {
event.preventDefault();
var button = event.currentTarget;
if ($(button).data('widget') !== 'pushmenu') {
button = $(button).closest(Selector.TOGGLE_BUTTON);
}
PushMenu._jQueryInterface.call($(button), 'toggle');
});
$(window).on('load', function () {
PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON));
});
/**
* 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);
/**
* --------------------------------------------
* 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,
EXPANDED: "expanded" + EVENT_KEY,
COLLAPSED: "collapsed" + EVENT_KEY,
LOAD_DATA_API: "load" + EVENT_KEY
};
var Selector = {
LI: '.nav-item',
LINK: '.nav-link',
TREEVIEW_MENU: '.nav-treeview',
OPEN: '.menu-open',
DATA_WIDGET: '[data-widget="treeview"]'
};
var ClassName = {
LI: 'nav-item',
LINK: 'nav-link',
TREEVIEW_MENU: 'nav-treeview',
OPEN: 'menu-open'
};
var Default = {
trigger: Selector.DATA_WIDGET + " " + Selector.LINK,
animationSpeed: 300,
accordion: true
/**
* Class Definition
* ====================================================
*/
};
var Treeview =
/*#__PURE__*/
function () {
function Treeview(element, config) {
this._config = config;
this._element = element;
} // Public
var _proto = Treeview.prototype;
_proto.init = function init() {
this._setupListeners();
};
_proto.expand = function expand(treeviewMenu, parentLi) {
var _this = this;
var expandedEvent = $.Event(Event.EXPANDED);
if (this._config.accordion) {
var openMenuLi = parentLi.siblings(Selector.OPEN).first();
var openTreeview = openMenuLi.find(Selector.TREEVIEW_MENU).first();
this.collapse(openTreeview, openMenuLi);
}
treeviewMenu.slideDown(this._config.animationSpeed, function () {
parentLi.addClass(ClassName.OPEN);
$(_this._element).trigger(expandedEvent);
});
};
_proto.collapse = function collapse(treeviewMenu, parentLi) {
var _this2 = this;
var collapsedEvent = $.Event(Event.COLLAPSED);
treeviewMenu.slideUp(this._config.animationSpeed, function () {
parentLi.removeClass(ClassName.OPEN);
$(_this2._element).trigger(collapsedEvent);
treeviewMenu.find(Selector.OPEN + " > " + Selector.TREEVIEW_MENU).slideUp();
treeviewMenu.find(Selector.OPEN).removeClass(ClassName.OPEN);
});
};
_proto.toggle = function toggle(event) {
var $relativeTarget = $(event.currentTarget);
var treeviewMenu = $relativeTarget.next();
if (!treeviewMenu.is(Selector.TREEVIEW_MENU)) {
return;
}
event.preventDefault();
var parentLi = $relativeTarget.parents(Selector.LI).first();
var isOpen = parentLi.hasClass(ClassName.OPEN);
if (isOpen) {
this.collapse($(treeviewMenu), parentLi);
} else {
this.expand($(treeviewMenu), parentLi);
}
} // Private
;
_proto._setupListeners = function _setupListeners() {
var _this3 = this;
$(document).on('click', this._config.trigger, function (event) {
_this3.toggle(event);
});
} // Static
;
Treeview._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = $.extend({}, Default, $(this).data());
if (!data) {
data = new Treeview($(this), _config);
$(this).data(DATA_KEY, data);
}
if (config === 'init') {
data[config]();
}
});
};
return Treeview;
}();
/**
* Data API
* ====================================================
*/
$(window).on(Event.LOAD_DATA_API, function () {
$(Selector.DATA_WIDGET).each(function () {
Treeview._jQueryInterface.call($(this), 'init');
});
});
/**
* 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);
/**
* --------------------------------------------
* AdminLTE DirectChat.js
* License MIT
* --------------------------------------------
*/
var DirectChat = function ($) {
/**
* Constants
* ====================================================
*/
var NAME = 'DirectChat';
var DATA_KEY = 'lte.directchat';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var Selector = {
DATA_TOGGLE: '[data-widget="chat-pane-toggle"]',
DIRECT_CHAT: '.direct-chat'
};
var ClassName = {
DIRECT_CHAT_OPEN: 'direct-chat-contacts-open'
};
/**
* Class Definition
* ====================================================
*/
var DirectChat =
/*#__PURE__*/
function () {
function DirectChat(element, config) {
this._element = element;
}
var _proto = DirectChat.prototype;
_proto.toggle = function toggle() {
$(this._element).parents(Selector.DIRECT_CHAT).first().toggleClass(ClassName.DIRECT_CHAT_OPEN);
} // Static
;
DirectChat._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
if (!data) {
data = new DirectChat($(this));
$(this).data(DATA_KEY, data);
}
data[config]();
});
};
return DirectChat;
}();
/**
*
* Data Api implementation
* ====================================================
*/
$(document).on('click', Selector.DATA_TOGGLE, function (event) {
if (event) event.preventDefault();
DirectChat._jQueryInterface.call($(this), 'toggle');
});
/**
* jQuery API
* ====================================================
*/
$.fn[NAME] = DirectChat._jQueryInterface;
$.fn[NAME].Constructor = DirectChat;
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return DirectChat._jQueryInterface;
};
return DirectChat;
}(jQuery);
/**
* --------------------------------------------
* AdminLTE TodoList.js
* License MIT
* --------------------------------------------
*/
var TodoList = function ($) {
/**
* Constants
* ====================================================
*/
var NAME = 'TodoList';
var DATA_KEY = 'lte.todolist';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var Selector = {
DATA_TOGGLE: '[data-widget="todo-list"]'
};
var ClassName = {
TODO_LIST_DONE: 'done'
};
var Default = {
onCheck: function onCheck(item) {
return item;
},
onUnCheck: function onUnCheck(item) {
return item;
}
/**
* Class Definition
* ====================================================
*/
};
var TodoList =
/*#__PURE__*/
function () {
function TodoList(element, config) {
this._config = config;
this._element = element;
this._init();
} // Public
var _proto = TodoList.prototype;
_proto.toggle = function toggle(item) {
item.parents('li').toggleClass(ClassName.TODO_LIST_DONE);
if (!$(item).prop('checked')) {
this.unCheck($(item));
return;
}
this.check(item);
};
_proto.check = function check(item) {
this._config.onCheck.call(item);
};
_proto.unCheck = function unCheck(item) {
this._config.onUnCheck.call(item);
} // Private
;
_proto._init = function _init() {
var that = this;
$(Selector.DATA_TOGGLE).find('input:checkbox:checked').parents('li').toggleClass(ClassName.TODO_LIST_DONE);
$(Selector.DATA_TOGGLE).on('change', 'input:checkbox', function (event) {
that.toggle($(event.target));
});
} // Static
;
TodoList._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = $.extend({}, Default, $(this).data());
if (!data) {
data = new TodoList($(this), _config);
$(this).data(DATA_KEY, data);
}
if (config === 'init') {
data[config]();
}
});
};
return TodoList;
}();
/**
* Data API
* ====================================================
*/
$(window).on('load', function () {
TodoList._jQueryInterface.call($(Selector.DATA_TOGGLE));
});
/**
* jQuery API
* ====================================================
*/
$.fn[NAME] = TodoList._jQueryInterface;
$.fn[NAME].Constructor = TodoList;
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return TodoList._jQueryInterface;
};
return TodoList;
}(jQuery);
/**
* --------------------------------------------
* AdminLTE Widget.js
* License MIT
* --------------------------------------------
*/
var Widget = function ($) {
/**
* Constants
* ====================================================
*/
var NAME = 'Widget';
var DATA_KEY = 'lte.widget';
var EVENT_KEY = "." + DATA_KEY;
var JQUERY_NO_CONFLICT = $.fn[NAME];
var Event = {
EXPANDED: "expanded" + EVENT_KEY,
COLLAPSED: "collapsed" + EVENT_KEY,
MAXIMIZED: "maximized" + EVENT_KEY,
MINIMIZED: "minimized" + EVENT_KEY,
REMOVED: "removed" + EVENT_KEY
};
var Selector = {
DATA_REMOVE: '[data-widget="remove"]',
DATA_COLLAPSE: '[data-widget="collapse"]',
DATA_MAXIMIZE: '[data-widget="maximize"]',
CARD: '.card',
CARD_HEADER: '.card-header',
CARD_BODY: '.card-body',
CARD_FOOTER: '.card-footer',
COLLAPSED: '.collapsed-card',
COLLAPSE_ICON: '.fa-minus',
EXPAND_ICON: '.fa-plus'
};
var ClassName = {
COLLAPSED: 'collapsed-card',
WAS_COLLAPSED: 'was-collapsed',
MAXIMIZED: 'maximized-card',
COLLAPSE_ICON: 'fa-minus',
EXPAND_ICON: 'fa-plus',
MAXIMIZE_ICON: 'fa-expand',
MINIMIZE_ICON: 'fa-compress'
};
var Default = {
animationSpeed: 'normal',
collapseTrigger: Selector.DATA_COLLAPSE,
removeTrigger: Selector.DATA_REMOVE
};
var Widget =
/*#__PURE__*/
function () {
function Widget(element, settings) {
this._element = element;
this._parent = element.parents(Selector.CARD).first();
this._settings = $.extend({}, Default, settings);
}
var _proto = Widget.prototype;
_proto.collapse = function collapse() {
var _this = this;
this._parent.children(Selector.CARD_BODY + ", " + Selector.CARD_FOOTER).slideUp(this._settings.animationSpeed, function () {
_this._parent.addClass(ClassName.COLLAPSED);
});
this._element.children(Selector.COLLAPSE_ICON).addClass(ClassName.EXPAND_ICON).removeClass(ClassName.COLLAPSE_ICON);
var collapsed = $.Event(Event.COLLAPSED);
this._element.trigger(collapsed, this._parent);
};
_proto.expand = function expand() {
var _this2 = this;
this._parent.children(Selector.CARD_BODY + ", " + Selector.CARD_FOOTER).slideDown(this._settings.animationSpeed, function () {
_this2._parent.removeClass(ClassName.COLLAPSED);
});
this._element.children(Selector.EXPAND_ICON).addClass(ClassName.COLLAPSE_ICON).removeClass(ClassName.EXPAND_ICON);
var expanded = $.Event(Event.EXPANDED);
this._element.trigger(expanded, this._parent);
};
_proto.remove = function remove() {
this._parent.slideUp();
var removed = $.Event(Event.REMOVED);
this._element.trigger(removed, this._parent);
};
_proto.toggle = function toggle() {
if (this._parent.hasClass(ClassName.COLLAPSED)) {
this.expand();
return;
}
this.collapse();
};
_proto.toggleMaximize = function toggleMaximize() {
var button = this._element.find('i');
if (this._parent.hasClass(ClassName.MAXIMIZED)) {
button.addClass(ClassName.MAXIMIZE_ICON).removeClass(ClassName.MINIMIZE_ICON);
this._parent.css('cssText', 'height:' + this._parent[0].style.height + ' !important;' + 'width:' + this._parent[0].style.width + ' !important; transition: all .15s;').delay(100).queue(function () {
$(this).removeClass(ClassName.MAXIMIZED);
$('html').removeClass(ClassName.MAXIMIZED);
$(this).trigger(Event.MINIMIZED);
$(this).css({
'height': 'inherit',
'width': 'inherit'
});
if ($(this).hasClass(ClassName.WAS_COLLAPSED)) {
$(this).removeClass(ClassName.WAS_COLLAPSED);
}
$(this).dequeue();
});
} else {
button.addClass(ClassName.MINIMIZE_ICON).removeClass(ClassName.MAXIMIZE_ICON);
this._parent.css({
'height': this._parent.height(),
'width': this._parent.width(),
'transition': 'all .15s'
}).delay(150).queue(function () {
$(this).addClass(ClassName.MAXIMIZED);
$('html').addClass(ClassName.MAXIMIZED);
$(this).trigger(Event.MAXIMIZED);
if ($(this).hasClass(ClassName.COLLAPSED)) {
$(this).addClass(ClassName.WAS_COLLAPSED);
}
$(this).dequeue();
});
}
} // Private
;
_proto._init = function _init(card) {
var _this3 = this;
this._parent = card;
$(this).find(this._settings.collapseTrigger).click(function () {
_this3.toggle();
});
$(this).find(this._settings.removeTrigger).click(function () {
_this3.remove();
});
} // Static
;
Widget._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
if (!data) {
data = new Widget($(this), data);
$(this).data(DATA_KEY, typeof config === 'string' ? data : config);
}
if (typeof config === 'string' && config.match(/collapse|expand|remove|toggle|toggleMaximize/)) {
data[config]();
} else if (typeof config === 'object') {
data._init($(this));
}
});
};
return Widget;
}();
/**
* Data API
* ====================================================
*/
$(document).on('click', Selector.DATA_COLLAPSE, function (event) {
if (event) {
event.preventDefault();
}
Widget._jQueryInterface.call($(this), 'toggle');
});
$(document).on('click', Selector.DATA_REMOVE, function (event) {
if (event) {
event.preventDefault();
}
Widget._jQueryInterface.call($(this), 'remove');
});
$(document).on('click', Selector.DATA_MAXIMIZE, function (event) {
if (event) {
event.preventDefault();
}
Widget._jQueryInterface.call($(this), 'toggleMaximize');
});
/**
* jQuery API
* ====================================================
*/
$.fn[NAME] = Widget._jQueryInterface;
$.fn[NAME].Constructor = Widget;
$.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT;
return Widget._jQueryInterface;
};
return Widget;
}(jQuery);
exports.ControlSidebar = ControlSidebar;
exports.DirectChat = DirectChat;
exports.Layout = Layout;
exports.PushMenu = PushMenu;
exports.TodoList = TodoList;
exports.Treeview = Treeview;
exports.Widget = Widget;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=adminlte.js.map