AdminLTE/dist/js/adminlte.min.js

7 lines
35 KiB
JavaScript
Raw Normal View History

2018-03-17 17:07:55 +00:00
/*!
* AdminLTE v3.1.0-pre (https://adminlte.io)
* Copyright 2014-2020 Colorlib <https://colorlib.com>
2019-10-23 07:51:31 +00:00
* Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
2018-03-17 17:07:55 +00:00
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).adminlte={},e.jQuery)}(this,(function(e,t){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(t),n="CardRefresh",s=i.default.fn[n],o={source:"",sourceSelector:"",params:{},trigger:'[data-card-widget="card-refresh"]',content:".card-body",loadInContent:!0,loadOnInit:!0,responseType:"",overlayTemplate:'<div class="overlay"><i class="fas fa-2x fa-sync-alt fa-spin"></i></div>',onLoadStart:function(){},onLoadDone:function(e){return e}},l=function(){function e(e,t){if(this._element=e,this._parent=e.parents(".card").first(),this._settings=i.default.extend({},o,t),this._overlay=i.default(this._settings.overlayTemplate),e.hasClass("card")&&(this._parent=e),""===this._settings.source)throw new Error("Source url was not defined. Please specify a url in your CardRefresh source option.")}var t=e.prototype;return t.load=function(){var e=this;this._addOverlay(),this._settings.onLoadStart.call(i.default(this)),i.default.get(this._settings.source,this._settings.params,(function(t){e._settings.loadInContent&&(""!==e._settings.sourceSelector&&(t=i.default(t).find(e._settings.sourceSelector).html()),e._parent.find(e._settings.content).html(t)),e._settings.onLoadDone.call(i.default(e),t),e._removeOverlay()}),""!==this._settings.responseType&&this._settings.responseType),i.default(this._element).trigger(i.default.Event("loaded.lte.cardrefresh"))},t._addOverlay=function(){this._parent.append(this._overlay),i.default(this._element).trigger(i.default.Event("overlay.added.lte.cardrefresh"))},t._removeOverlay=function(){this._parent.find(this._overlay).remove(),i.default(this._element).trigger(i.default.Event("overlay.removed.lte.cardrefresh"))},t._init=function(){var e=this;i.default(this).find(this._settings.trigger).on("click",(function(){e.load()})),this._settings.loadOnInit&&this.load()},e._jQueryInterface=function(t){var a=i.default(this).data("lte.cardrefresh"),n=i.default.extend({},o,i.default(this).data());a||(a=new e(i.default(this),n),i.default(this).data("lte.cardrefresh","string"==typeof t?a:t)),"string"==typeof t&&t.match(/load/)?a[t]():a._init(i.default(this))},e}();i.default(document).on("click",'[data-card-widget="card-refresh"]',(function(e){e&&e.preventDefault(),l._jQueryInterface.call(i.default(this),"load")})),i.default((function(){i.default('[data-card-widget="card-refresh"]').each((function(){l._jQueryInterface.call(i.default(this))}))})),i.default.fn[n]=l._jQueryInterface,i.default.fn[n].Constructor=l,i.default.fn[n].noConflict=function(){return i.default.fn[n]=s,l._jQueryInterface};var r="CardWidget",d=i.default.fn[r],u={animationSpeed:"normal",collapseTrigger:'[data-card-widget="collapse"]',removeTrigger:'[data-card-widget="remove"]',maximizeTrigger:'[data-card-widget="maximize"]',collapseIcon:"fa-minus",expandIcon:"fa-plus",maximizeIcon:"fa-expand",minimizeIcon:"fa-compress"},f=function(){function e(e,t){this._element=e,this._parent=e.parents(".card").first(),e.hasClass("card")&&(this._parent=e),this._settings=i.default.extend({},u,t)}var t=e.prototype;return t.collapse=function(){var e=this;this._parent.addClass("collapsing-card").children(".card-body, .card-footer").slideUp(this._settings.animationSpeed,(function(){e._parent.addClass("collapsed-card").removeClass("collapsing-card")})),this._parent.find("> .card-header "+this._settings.collapseTrigger+" ."+this._settings.collapseIcon).addClass(this._settings.expandIcon).removeClass(this._settings.collapseIcon),this._element.trigger(i.default.Event("collapsed.lte.cardwidget"),this._parent)},t.expand=function(){var e=this;this._parent.addClass("expanding-card").children(".card-body, .card-footer").slideDown(this._settings.animationSpeed,(function(){e._parent.removeClass("collapsed-card").removeClass("expanding-card")})),this._parent.find("> .card-header "+this._settings.collapseTrigger+" ."+this._settings.expandI
2018-03-17 17:07:55 +00:00
//# sourceMappingURL=adminlte.min.js.map