未验证 提交 9c640e0f 编写于 作者: R REJack

added ability for auto collapse sidebar option

上级 42568b9b
......@@ -187,4 +187,4 @@ const Layout = (($) => {
return Layout
})(jQuery)
export default Layout
\ No newline at end of file
export default Layout
......@@ -22,6 +22,7 @@ const PushMenu = (($) => {
}
const Default = {
autoCollapseSize: false,
screenCollapseSize: 768
}
......@@ -51,6 +52,8 @@ const PushMenu = (($) => {
this._element = element
this._options = $.extend({}, Default, options)
this._init()
if (!$(Selector.OVERLAY).length) {
this._addOverlay()
}
......@@ -72,23 +75,48 @@ const PushMenu = (($) => {
$(this._element).trigger(collapsedEvent)
}
toggle() {
let isShown
isShown() {
if ($(window).width() >= this._options.screenCollapseSize) {
isShown = !$(Selector.BODY).hasClass(ClassName.COLLAPSED)
return !$(Selector.BODY).hasClass(ClassName.COLLAPSED)
} else {
isShown = $(Selector.BODY).hasClass(ClassName.OPEN)
return $(Selector.BODY).hasClass(ClassName.OPEN)
}
if (isShown) {
}
toggle() {
if (this.isShown()) {
this.collapse()
} else {
this.show()
}
}
autoCollapse() {
console.log(this._options)
if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) {
if (this.isShown()) {
this.toggle()
}
} else {
if (!this.isShown()) {
this.toggle()
}
}
}
}
// Private
_init() {
this.autoCollapse()
$(window).resize(() => {
this.autoCollapse()
})
}
_addOverlay() {
const overlay = $('<div />', {
id: 'sidebar-overlay'
......@@ -113,7 +141,7 @@ const PushMenu = (($) => {
$(this).data(DATA_KEY, data)
}
if (operation) {
if (operation === 'init') {
data[operation]()
}
})
......@@ -137,6 +165,10 @@ const PushMenu = (($) => {
PushMenu._jQueryInterface.call($(button), 'toggle')
})
$(window).on('load', () => {
PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON))
})
/**
* jQuery API
* ====================================================
......
......@@ -382,6 +382,7 @@ var PushMenu = function ($) {
};
var Default = {
autoCollapseSize: false,
screenCollapseSize: 768
};
......@@ -413,6 +414,8 @@ var PushMenu = function ($) {
this._element = element;
this._options = $.extend({}, Default, options);
this._init();
if (!$(Selector.OVERLAY).length) {
this._addOverlay();
}
......@@ -434,34 +437,58 @@ var PushMenu = function ($) {
$(this._element).trigger(collapsedEvent);
};
PushMenu.prototype.toggle = function toggle() {
var isShown = void 0;
PushMenu.prototype.isShown = function isShown() {
if ($(window).width() >= this._options.screenCollapseSize) {
isShown = !$(Selector.BODY).hasClass(ClassName.COLLAPSED);
return !$(Selector.BODY).hasClass(ClassName.COLLAPSED);
} else {
isShown = $(Selector.BODY).hasClass(ClassName.OPEN);
return $(Selector.BODY).hasClass(ClassName.OPEN);
}
};
if (isShown) {
PushMenu.prototype.toggle = function toggle() {
if (this.isShown()) {
this.collapse();
} else {
this.show();
}
};
PushMenu.prototype.autoCollapse = function autoCollapse() {
console.log(this._options);
if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) {
if (this.isShown()) {
this.toggle();
}
} else {
if (!this.isShown()) {
this.toggle();
}
}
}
};
// Private
PushMenu.prototype._init = function _init() {
var _this = this;
this.autoCollapse();
$(window).resize(function () {
_this.autoCollapse();
});
};
PushMenu.prototype._addOverlay = function _addOverlay() {
var _this = this;
var _this2 = this;
var overlay = $('<div />', {
id: 'sidebar-overlay'
});
overlay.on('click', function () {
_this.collapse();
_this2.collapse();
});
$(Selector.WRAPPER).append(overlay);
......@@ -479,7 +506,7 @@ var PushMenu = function ($) {
$(this).data(DATA_KEY, data);
}
if (operation) {
if (operation === 'init') {
data[operation]();
}
});
......@@ -505,6 +532,10 @@ var PushMenu = function ($) {
PushMenu._jQueryInterface.call($(button), 'toggle');
});
$(window).on('load', function () {
PushMenu._jQueryInterface.call($(Selector.TOGGLE_BUTTON));
});
/**
* jQuery API
* ====================================================
......
此差异已折叠。
......@@ -3,5 +3,5 @@
* Copyright 2014-2019 Abdullah Almsaeed <abdullah@almsaeedstudio.com>
* Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE)
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.adminlte={})}(this,function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i,t,o,r,s,a,c,l,d,f,h,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=(i=jQuery,t="ControlSidebar",o="lte.control.sidebar",r=i.fn[t],s=".control-sidebar",a='[data-widget="control-sidebar"]',c=".main-header",l="control-sidebar-open",d="control-sidebar-slide-open",f={slide:!0},g.prototype.show=function(){this._config.slide?i("body").removeClass(d):i("body").removeClass(l)},g.prototype.collapse=function(){this._config.slide?i("body").addClass(d):i("body").addClass(l)},g.prototype.toggle=function(){this._setMargin(),i("body").hasClass(l)||i("body").hasClass(d)?this.show():this.collapse()},g.prototype._getConfig=function(e){return i.extend({},f,e)},g.prototype._setMargin=function(){i(s).css({top:i(c).innerHeight()})},g._jQueryInterface=function(t){return this.each(function(){var e=i(this).data(o);if(e||(e=new g(this,i(this).data()),i(this).data(o,e)),"undefined"===e[t])throw new Error(t+" is not a function");e[t]()})},h=g,i(document).on("click",a,function(e){e.preventDefault(),h._jQueryInterface.call(i(this),"toggle")}),i.fn[t]=h._jQueryInterface,i.fn[t].Constructor=h,i.fn[t].noConflict=function(){return i.fn[t]=r,h._jQueryInterface},h);function g(e,t){n(this,g),this._element=e,this._config=this._getConfig(t)}var y,_,m,v,b,C,w,E,j,S,D,x,Q,A,I,L,O=(y=jQuery,_="Layout",m="lte.layout",v=y.fn[_],b=".main-header",C=".main-sidebar .sidebar",w=".content-wrapper",E=".brand-link",j=".control-sidebar",S=".main-footer",D="hold-transition",x="layout-fixed",Q="layout-navbar-fixed",A="layout-footer-fixed",I={scrollbarTheme:"os-theme-light",scrollbarAutoHide:"l"},P.prototype.fixLayoutHeight=function(){var e={window:y(window).height(),header:y(b).outerHeight(),footer:y(S).outerHeight(),sidebar:y(C).height()},t=this._max(e);y("body").hasClass(x)?(y(w).css("min-height",t-e.header-e.footer),y(j+" .control-sidebar-content").css("height",t-e.header),"undefined"!=typeof y.fn.overlayScrollbars&&(y(C).overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}),y(j+" .control-sidebar-content").overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}))):e.sidebar<e.window?y(w).css("min-height",e.window-e.header-e.footer):y(w).css("min-height",e.sidebar-e.header),y("body").hasClass(Q)&&(y(E).css("height",e.header),y(C).css("margin-top",e.header),y(C).css("margin-top",e.header)),y("body").hasClass(A)&&y(w).css("margin-bottom",e.footer)},P.prototype._init=function(){var e=this;y("body").removeClass(D),this.fixLayoutHeight(),y(C).on("collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu",function(){e.fixLayoutHeight()}),y(window).resize(function(){e.fixLayoutHeight()}),y("body, html").css("height","auto")},P.prototype._max=function(t){var n=0;return Object.keys(t).forEach(function(e){t[e]>n&&(n=t[e])}),n},P._jQueryInterface=function(n){return this.each(function(){var e=y(this).data(m),t=y.extend({},I,y(this).data());e||(e=new P(y(this),t),y(this).data(m,e)),"init"===n&&e[n]()})},L=P,y(window).on("load",function(){L._jQueryInterface.call(y("body"))}),y.fn[_]=L._jQueryInterface,y.fn[_].Constructor=L,y.fn[_].noConflict=function(){return y.fn[_]=v,L._jQueryInterface},L);function P(e,t){n(this,P),this._config=t,this._element=e,this._init()}var T,H,k,N,M,z,U,W,X,R,V,q,B,F,G=(T=jQuery,H="PushMenu",N="."+(k="lte.pushmenu"),M=T.fn[H],z={COLLAPSED:"collapsed"+N,SHOWN:"shown"+N},U={screenCollapseSize:768},W='[data-widget="pushmenu"]',X="body",R="#sidebar-overlay",V=".wrapper",q="sidebar-collapse",B="sidebar-open",J.prototype.show=function(){T(X).addClass(B).removeClass(q);var e=T.Event(z.SHOWN);T(this._element).trigger(e)},J.prototype.collapse=function(){T(X).removeClass(B).addClass(q);var e=T.Event(z.COLLAPSED);T(this._element).trigger(e)},J.prototype.toggle=function(){(T(window).width()>=this._options.screenCollapseSize?!T(X).hasClass(q):T(X).hasClass(B))?this.collapse():this.show()},J.prototype._addOverlay=function(){var e=this,t=T("<div />",{id:"sidebar-overlay"});t.on("click",function(){e.collapse()}),T(V).append(t)},J._jQueryInterface=function(n){return this.each(function(){var e=T(this).data(k),t=T.extend({},U,T(this).data());e||(e=new J(this,t),T(this).data(k,e)),n&&e[n]()})},F=J,T(document).on("click",W,function(e){e.preventDefault();var t=e.currentTarget;"pushmenu"!==T(t).data("widget")&&(t=T(t).closest(W)),F._jQueryInterface.call(T(t),"toggle")}),T.fn[H]=F._jQueryInterface,T.fn[H].Constructor=F,T.fn[H].noConflict=function(){return T.fn[H]=M,F._jQueryInterface},F);function J(e,t){n(this,J),this._element=e,this._options=T.extend({},U,t),T(R).length||this._addOverlay()}var K,Y,Z,$,ee,te,ne,ie,oe,re,se,ae,ce,le=(K=jQuery,Y="Treeview",$="."+(Z="lte.treeview"),ee=K.fn[Y],te={SELECTED:"selected"+$,EXPANDED:"expanded"+$,COLLAPSED:"collapsed"+$,LOAD_DATA_API:"load"+$},ne=".nav-item",ie=".nav-treeview",oe=".menu-open",se="menu-open",ae={trigger:(re='[data-widget="treeview"]')+" "+".nav-link",animationSpeed:300,accordion:!0},de.prototype.init=function(){this._setupListeners()},de.prototype.expand=function(e,t){var n=this,i=K.Event(te.EXPANDED);if(this._config.accordion){var o=t.siblings(oe).first(),r=o.find(ie).first();this.collapse(r,o)}e.slideDown(this._config.animationSpeed,function(){t.addClass(se),K(n._element).trigger(i)})},de.prototype.collapse=function(e,t){var n=this,i=K.Event(te.COLLAPSED);e.slideUp(this._config.animationSpeed,function(){t.removeClass(se),K(n._element).trigger(i),e.find(oe+" > "+ie).slideUp(),e.find(oe).removeClass(se)})},de.prototype.toggle=function(e){var t=K(e.currentTarget),n=t.next();if(n.is(ie)){e.preventDefault();var i=t.parents(ne).first();i.hasClass(se)?this.collapse(K(n),i):this.expand(K(n),i)}},de.prototype._setupListeners=function(){var t=this;K(document).on("click",this._config.trigger,function(e){t.toggle(e)})},de._jQueryInterface=function(n){return this.each(function(){var e=K(this).data(Z),t=K.extend({},ae,K(this).data());e||(e=new de(K(this),t),K(this).data(Z,e)),"init"===n&&e[n]()})},ce=de,K(window).on(te.LOAD_DATA_API,function(){K(re).each(function(){ce._jQueryInterface.call(K(this),"init")})}),K.fn[Y]=ce._jQueryInterface,K.fn[Y].Constructor=ce,K.fn[Y].noConflict=function(){return K.fn[Y]=ee,ce._jQueryInterface},ce);function de(e,t){n(this,de),this._config=t,this._element=e}var fe,he,ue,pe,ge,ye,_e,me,ve,be,Ce,we,Ee,je,Se,De,xe,Qe,Ae=(fe=jQuery,he="Widget",pe="."+(ue="lte.widget"),ge=fe.fn[he],ye={EXPANDED:"expanded"+pe,COLLAPSED:"collapsed"+pe,REMOVED:"removed"+pe},ve=".card",be=".card-body",Ce=".card-footer",we=".fa-minus",Ee=".fa-plus",je="collapsed-card",Se="fa-minus",De="fa-plus",xe={animationSpeed:"normal",collapseTrigger:me='[data-widget="collapse"]',removeTrigger:_e='[data-widget="remove"]'},Ie.prototype.collapse=function(){var e=this;this._parent.children(be+", "+Ce).slideUp(this._settings.animationSpeed,function(){e._parent.addClass(je)}),this._element.children(we).addClass(De).removeClass(Se);var t=fe.Event(ye.COLLAPSED);this._element.trigger(t,this._parent)},Ie.prototype.expand=function(){var e=this;this._parent.children(be+", "+Ce).slideDown(this._settings.animationSpeed,function(){e._parent.removeClass(je)}),this._element.children(Ee).addClass(Se).removeClass(De);var t=fe.Event(ye.EXPANDED);this._element.trigger(t,this._parent)},Ie.prototype.remove=function(){this._parent.slideUp();var e=fe.Event(ye.REMOVED);this._element.trigger(e,this._parent)},Ie.prototype.toggle=function(){this._parent.hasClass(je)?this.expand():this.collapse()},Ie.prototype._init=function(e){var t=this;this._parent=e,fe(this).find(this._settings.collapseTrigger).click(function(){t.toggle()}),fe(this).find(this._settings.removeTrigger).click(function(){t.remove()})},Ie._jQueryInterface=function(t){return this.each(function(){var e=fe(this).data(ue);e||(e=new Ie(fe(this),e),fe(this).data(ue,"string"==typeof t?e:t)),"string"==typeof t&&t.match(/remove|toggle/)?e[t]():"object"===("undefined"==typeof t?"undefined":u(t))&&e._init(fe(this))})},Qe=Ie,fe(document).on("click",me,function(e){e&&e.preventDefault(),Qe._jQueryInterface.call(fe(this),"toggle")}),fe(document).on("click",_e,function(e){e&&e.preventDefault(),Qe._jQueryInterface.call(fe(this),"remove")}),fe.fn[he]=Qe._jQueryInterface,fe.fn[he].Constructor=Qe,fe.fn[he].noConflict=function(){return fe.fn[he]=ge,Qe._jQueryInterface},Qe);function Ie(e,t){n(this,Ie),this._element=e,this._parent=e.parents(ve).first(),this._settings=fe.extend({},xe,t)}e.ControlSidebar=p,e.Layout=O,e.PushMenu=G,e.Treeview=le,e.Widget=Ae,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.adminlte={})}(this,function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i,t,o,r,s,a,l,c,f,d,h,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=(i=jQuery,t="ControlSidebar",o="lte.control.sidebar",r=i.fn[t],s=".control-sidebar",a='[data-widget="control-sidebar"]',l=".main-header",c="control-sidebar-open",f="control-sidebar-slide-open",d={slide:!0},g.prototype.show=function(){this._config.slide?i("body").removeClass(f):i("body").removeClass(c)},g.prototype.collapse=function(){this._config.slide?i("body").addClass(f):i("body").addClass(c)},g.prototype.toggle=function(){this._setMargin(),i("body").hasClass(c)||i("body").hasClass(f)?this.show():this.collapse()},g.prototype._getConfig=function(e){return i.extend({},d,e)},g.prototype._setMargin=function(){i(s).css({top:i(l).innerHeight()})},g._jQueryInterface=function(t){return this.each(function(){var e=i(this).data(o);if(e||(e=new g(this,i(this).data()),i(this).data(o,e)),"undefined"===e[t])throw new Error(t+" is not a function");e[t]()})},h=g,i(document).on("click",a,function(e){e.preventDefault(),h._jQueryInterface.call(i(this),"toggle")}),i.fn[t]=h._jQueryInterface,i.fn[t].Constructor=h,i.fn[t].noConflict=function(){return i.fn[t]=r,h._jQueryInterface},h);function g(e,t){n(this,g),this._element=e,this._config=this._getConfig(t)}var y,_,m,v,b,w,C,S,j,E,D,x,Q,I,A,L,O=(y=jQuery,_="Layout",m="lte.layout",v=y.fn[_],b=".main-header",w=".main-sidebar .sidebar",C=".content-wrapper",S=".brand-link",j=".control-sidebar",E=".main-footer",D="hold-transition",x="layout-fixed",Q="layout-navbar-fixed",I="layout-footer-fixed",A={scrollbarTheme:"os-theme-light",scrollbarAutoHide:"l"},P.prototype.fixLayoutHeight=function(){var e={window:y(window).height(),header:y(b).outerHeight(),footer:y(E).outerHeight(),sidebar:y(w).height()},t=this._max(e);y("body").hasClass(x)?(y(C).css("min-height",t-e.header-e.footer),y(j+" .control-sidebar-content").css("height",t-e.header),"undefined"!=typeof y.fn.overlayScrollbars&&(y(w).overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}),y(j+" .control-sidebar-content").overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}))):e.sidebar<e.window?y(C).css("min-height",e.window-e.header-e.footer):y(C).css("min-height",e.sidebar-e.header),y("body").hasClass(Q)&&(y(S).css("height",e.header),y(w).css("margin-top",e.header),y(w).css("margin-top",e.header)),y("body").hasClass(I)&&y(C).css("margin-bottom",e.footer)},P.prototype._init=function(){var e=this;y("body").removeClass(D),this.fixLayoutHeight(),y(w).on("collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu",function(){e.fixLayoutHeight()}),y(window).resize(function(){e.fixLayoutHeight()}),y("body, html").css("height","auto")},P.prototype._max=function(t){var n=0;return Object.keys(t).forEach(function(e){t[e]>n&&(n=t[e])}),n},P._jQueryInterface=function(n){return this.each(function(){var e=y(this).data(m),t=y.extend({},A,y(this).data());e||(e=new P(y(this),t),y(this).data(m,e)),"init"===n&&e[n]()})},L=P,y(window).on("load",function(){L._jQueryInterface.call(y("body"))}),y.fn[_]=L._jQueryInterface,y.fn[_].Constructor=L,y.fn[_].noConflict=function(){return y.fn[_]=v,L._jQueryInterface},L);function P(e,t){n(this,P),this._config=t,this._element=e,this._init()}var T,H,k,z,N,M,U,W,X,R,V,q,B,F,G=(T=jQuery,H="PushMenu",z="."+(k="lte.pushmenu"),N=T.fn[H],U={autoCollapseSize:!(M={COLLAPSED:"collapsed"+z,SHOWN:"shown"+z}),screenCollapseSize:768},W='[data-widget="pushmenu"]',X="body",R="#sidebar-overlay",V=".wrapper",q="sidebar-collapse",B="sidebar-open",J.prototype.show=function(){T(X).addClass(B).removeClass(q);var e=T.Event(M.SHOWN);T(this._element).trigger(e)},J.prototype.collapse=function(){T(X).removeClass(B).addClass(q);var e=T.Event(M.COLLAPSED);T(this._element).trigger(e)},J.prototype.isShown=function(){return T(window).width()>=this._options.screenCollapseSize?!T(X).hasClass(q):T(X).hasClass(B)},J.prototype.toggle=function(){this.isShown()?this.collapse():this.show()},J.prototype.autoCollapse=function(){console.log(this._options),this._options.autoCollapseSize&&(T(window).width()<=this._options.autoCollapseSize?this.isShown()&&this.toggle():this.isShown()||this.toggle())},J.prototype._init=function(){var e=this;this.autoCollapse(),T(window).resize(function(){e.autoCollapse()})},J.prototype._addOverlay=function(){var e=this,t=T("<div />",{id:"sidebar-overlay"});t.on("click",function(){e.collapse()}),T(V).append(t)},J._jQueryInterface=function(n){return this.each(function(){var e=T(this).data(k),t=T.extend({},U,T(this).data());e||(e=new J(this,t),T(this).data(k,e)),"init"===n&&e[n]()})},F=J,T(document).on("click",W,function(e){e.preventDefault();var t=e.currentTarget;"pushmenu"!==T(t).data("widget")&&(t=T(t).closest(W)),F._jQueryInterface.call(T(t),"toggle")}),T(window).on("load",function(){F._jQueryInterface.call(T(W))}),T.fn[H]=F._jQueryInterface,T.fn[H].Constructor=F,T.fn[H].noConflict=function(){return T.fn[H]=N,F._jQueryInterface},F);function J(e,t){n(this,J),this._element=e,this._options=T.extend({},U,t),this._init(),T(R).length||this._addOverlay()}var K,Y,Z,$,ee,te,ne,ie,oe,re,se,ae,le,ce=(K=jQuery,Y="Treeview",$="."+(Z="lte.treeview"),ee=K.fn[Y],te={SELECTED:"selected"+$,EXPANDED:"expanded"+$,COLLAPSED:"collapsed"+$,LOAD_DATA_API:"load"+$},ne=".nav-item",ie=".nav-treeview",oe=".menu-open",se="menu-open",ae={trigger:(re='[data-widget="treeview"]')+" "+".nav-link",animationSpeed:300,accordion:!0},fe.prototype.init=function(){this._setupListeners()},fe.prototype.expand=function(e,t){var n=this,i=K.Event(te.EXPANDED);if(this._config.accordion){var o=t.siblings(oe).first(),r=o.find(ie).first();this.collapse(r,o)}e.slideDown(this._config.animationSpeed,function(){t.addClass(se),K(n._element).trigger(i)})},fe.prototype.collapse=function(e,t){var n=this,i=K.Event(te.COLLAPSED);e.slideUp(this._config.animationSpeed,function(){t.removeClass(se),K(n._element).trigger(i),e.find(oe+" > "+ie).slideUp(),e.find(oe).removeClass(se)})},fe.prototype.toggle=function(e){var t=K(e.currentTarget),n=t.next();if(n.is(ie)){e.preventDefault();var i=t.parents(ne).first();i.hasClass(se)?this.collapse(K(n),i):this.expand(K(n),i)}},fe.prototype._setupListeners=function(){var t=this;K(document).on("click",this._config.trigger,function(e){t.toggle(e)})},fe._jQueryInterface=function(n){return this.each(function(){var e=K(this).data(Z),t=K.extend({},ae,K(this).data());e||(e=new fe(K(this),t),K(this).data(Z,e)),"init"===n&&e[n]()})},le=fe,K(window).on(te.LOAD_DATA_API,function(){K(re).each(function(){le._jQueryInterface.call(K(this),"init")})}),K.fn[Y]=le._jQueryInterface,K.fn[Y].Constructor=le,K.fn[Y].noConflict=function(){return K.fn[Y]=ee,le._jQueryInterface},le);function fe(e,t){n(this,fe),this._config=t,this._element=e}var de,he,ue,pe,ge,ye,_e,me,ve,be,we,Ce,Se,je,Ee,De,xe,Qe,Ie=(de=jQuery,he="Widget",pe="."+(ue="lte.widget"),ge=de.fn[he],ye={EXPANDED:"expanded"+pe,COLLAPSED:"collapsed"+pe,REMOVED:"removed"+pe},ve=".card",be=".card-body",we=".card-footer",Ce=".fa-minus",Se=".fa-plus",je="collapsed-card",Ee="fa-minus",De="fa-plus",xe={animationSpeed:"normal",collapseTrigger:me='[data-widget="collapse"]',removeTrigger:_e='[data-widget="remove"]'},Ae.prototype.collapse=function(){var e=this;this._parent.children(be+", "+we).slideUp(this._settings.animationSpeed,function(){e._parent.addClass(je)}),this._element.children(Ce).addClass(De).removeClass(Ee);var t=de.Event(ye.COLLAPSED);this._element.trigger(t,this._parent)},Ae.prototype.expand=function(){var e=this;this._parent.children(be+", "+we).slideDown(this._settings.animationSpeed,function(){e._parent.removeClass(je)}),this._element.children(Se).addClass(Ee).removeClass(De);var t=de.Event(ye.EXPANDED);this._element.trigger(t,this._parent)},Ae.prototype.remove=function(){this._parent.slideUp();var e=de.Event(ye.REMOVED);this._element.trigger(e,this._parent)},Ae.prototype.toggle=function(){this._parent.hasClass(je)?this.expand():this.collapse()},Ae.prototype._init=function(e){var t=this;this._parent=e,de(this).find(this._settings.collapseTrigger).click(function(){t.toggle()}),de(this).find(this._settings.removeTrigger).click(function(){t.remove()})},Ae._jQueryInterface=function(t){return this.each(function(){var e=de(this).data(ue);e||(e=new Ae(de(this),e),de(this).data(ue,"string"==typeof t?e:t)),"string"==typeof t&&t.match(/remove|toggle/)?e[t]():"object"===("undefined"==typeof t?"undefined":u(t))&&e._init(de(this))})},Qe=Ae,de(document).on("click",me,function(e){e&&e.preventDefault(),Qe._jQueryInterface.call(de(this),"toggle")}),de(document).on("click",_e,function(e){e&&e.preventDefault(),Qe._jQueryInterface.call(de(this),"remove")}),de.fn[he]=Qe._jQueryInterface,de.fn[he].Constructor=Qe,de.fn[he].noConflict=function(){return de.fn[he]=ge,Qe._jQueryInterface},Qe);function Ae(e,t){n(this,Ae),this._element=e,this._parent=e.parents(ve).first(),this._settings=de.extend({},xe,t)}e.ControlSidebar=p,e.Layout=O,e.PushMenu=G,e.Treeview=ce,e.Widget=Ie,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=adminlte.min.js.map
\ No newline at end of file
此差异已折叠。
......@@ -37,7 +37,7 @@
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" data-screen-collapse-size="768" href="#"><i class="fas fa-bars"></i></a>
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="index3.html" class="nav-link">Home</a>
......@@ -549,7 +549,7 @@
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Dashboard v2</li>
<li class="breadcrumb-item active">Dashboard v1</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册