diff --git a/build/js/dist/Layout.js b/build/js/dist/Layout.js index adfd082b6..13beee610 100644 --- a/build/js/dist/Layout.js +++ b/build/js/dist/Layout.js @@ -64,10 +64,10 @@ var Layout = function ($) { _createClass(Layout, [{ key: 'fixLayoutHeight', value: function fixLayoutHeight() { - var heights = [$(window).height(), $(Selector.HEADER).outerHeight(), $(Selector.FOOTER).outerHeight()]; + var heights = [$(window).height(), $(Selector.HEADER).outerHeight(), $(Selector.FOOTER).outerHeight(), $(Selector.SIDEBAR).height()], + max = this._max(heights); - $(Selector.CONTENT).css('min-height', heights[0] - (heights[1] + heights[2])); - console.log(heights[0] - (heights[1] + heights[2])); + $(Selector.CONTENT).css('min-height', max - (heights[1] + heights[2])); } // Private @@ -80,7 +80,7 @@ var Layout = function ($) { $('body').removeClass(ClassName.HOLD); this.fixLayoutHeight(); - $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview', function () { + $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', function () { _this.fixLayoutHeight(); }); $(window).resize(function () { diff --git a/build/js/dist/Layout.js.map b/build/js/dist/Layout.js.map index b66451f5e..9cd3cbe99 100644 --- a/build/js/dist/Layout.js.map +++ b/build/js/dist/Layout.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/Layout.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,SAAU,UAAC,CAAD,EAAO;AACrB;;;;;;;AAOA,MAAM,OAAqB,QAA3B;AACA,MAAM,WAAqB,YAA3B;AACA,MAAM,kBAAyB,QAA/B;AACA,MAAM,qBAAqB,EAAE,EAAF,CAAK,IAAL,CAA3B;;AAEA,MAAM,QAAQ;AACZ,aAAS;AADG,GAAd;;AAIA,MAAM,WAAW;AACf,aAAS,eADM;AAEf,YAAQ,cAFO;AAGf,aAAS,kBAHM;AAIf,oBAAgB,iBAJD;AAKf,aAAS,UALM;AAMf,qBAAiB,kBANF;AAOf,kBAAc,e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O,EAAE,IAAF,EAAQ,IAAR,CAAa,QAAb,CAAX;;AAEA,cAAI,CAAC,IAAL,EAAW;AACT,mBAAO,IAAI,MAAJ,CAAW,IAAX,CAAP;AACA,cAAE,IAAF,EAAQ,IAAR,CAAa,QAAb,EAAuB,IAAvB;AACD;;AAED,cAAI,SAAJ,EAAe;AACb,iBAAK,SAAL;AACD;AACF,SAXM,CAAP;AAYD;AArGkB;;AAAA;AAAA;;;;;;;AA6GrB,IAAE,EAAF,CAAK,IAAL,IAAa,OAAO,gBAApB;AACA,IAAE,EAAF,CAAK,IAAL,EAAW,WAAX,GAAyB,MAAzB;AACA,IAAE,EAAF,CAAK,IAAL,EAAW,UAAX,GAAyB,YAAY;AACnC,MAAE,EAAF,CAAK,IAAL,IAAa,kBAAb;AACA,WAAO,OAAO,gBAAd;AACD,GAHD;;AAKA,SAAO,MAAP;AAED,CAtHc,CAsHZ,MAtHY,CAAf","file":"Layout.js","sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE Layout.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Layout = (($) => {\n 'use strict'\n\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'Layout'\n const DATA_KEY = 'lte.layout'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n SIDEBAR: 'sidebar'\n }\n\n const Selector = {\n SIDEBAR: '.main-sidebar',\n HEADER: '.main-header',\n CONTENT: '.content-wrapper',\n CONTENT_HEADER: '.content-header',\n WRAPPER: '.wrapper',\n CONTROL_SIDEBAR: '.control-sidebar',\n LAYOUT_FIXED: '.layout-fixed',\n FOOTER: '.main-footer'\n }\n\n const ClassName = {\n HOLD: 'hold-transition',\n SIDEBAR: 'main-sidebar',\n LAYOUT_FIXED: 'layout-fixed'\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class Layout {\n\n constructor(element) {\n this._element = element\n\n this._init()\n }\n\n // Public\n\n fixLayoutHeight() {\n let heights = [\n $(window).height(),\n $(Selector.HEADER).outerHeight(),\n $(Selector.FOOTER).outerHeight()\n ]\n\n $(Selector.CONTENT).css('min-height', heights[0] - (heights[1] + heights[2]))\n console.log(heights[0] - (heights[1] + heights[2]))\n }\n\n // Private\n\n _init() {\n $('body').removeClass(ClassName.HOLD)\n\n this.fixLayoutHeight()\n $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview', () => {\n this.fixLayoutHeight()\n })\n $(window).resize(() => {\n this.fixLayoutHeight()\n })\n }\n\n _max(numbers) {\n let max = 0\n\n numbers.forEach((v) => {\n if (v > max) {\n max = v\n }\n })\n\n return max\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 Layout(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (operation) {\n data[operation]()\n }\n })\n }\n }\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = Layout._jQueryInterface\n $.fn[NAME].Constructor = Layout\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Layout._jQueryInterface\n }\n\n return Layout\n\n})(jQuery)\n"]} \ No newline at end of file +{"version":3,"sources":["../src/Layout.js"],"names":["Layout","$","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","Event","SIDEBAR","Selector","HEADER","CONTENT","CONTENT_HEADER","WRAPPER","CONTROL_SIDEBAR","LAYOUT_FIXED","FOOTER","ClassName","HOLD","element","_element","_init","heights","window","height","outerHeight","max","_max","css","removeClass","fixLayoutHeight","on","resize","numbers","forEach","v","operation","each","data","_jQueryInterface","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAAA;;;;;;;AAOA,IAAMA,SAAU,UAACC,CAAD,EAAO;AACrB;;AAEA;;;;;AAKA,MAAMC,OAAO,QAAb;AACA,MAAMC,WAAW,YAAjB;AACA,MAAMC,kBAAgBD,QAAtB;AACA,MAAME,qBAAqBJ,EA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AzEkB;AAAA;AAAA,2BA2EdG,OA3Ec,EA2EL;AACZ,YAAIP,MAAM,CAAV;;AAEAO,gBAAQC,OAAR,CAAgB,UAACC,CAAD,EAAO;AACrB,cAAIA,IAAIT,GAAR,EAAa;AACXA,kBAAMS,CAAN;AACD;AACF,SAJD;;AAMA,eAAOT,GAAP;AACD;;AAED;;AAvFmB;AAAA;AAAA,uCAyFKU,SAzFL,EAyFgB;AACjC,eAAO,KAAKC,IAAL,CAAU,YAAY;AAC3B,cAAIC,OAAOrC,EAAE,IAAF,EAAQqC,IAAR,CAAanC,QAAb,CAAX;;AAEA,cAAI,CAACmC,IAAL,EAAW;AACTA,mBAAO,IAAItC,MAAJ,CAAW,IAAX,CAAP;AACAC,cAAE,IAAF,EAAQqC,IAAR,CAAanC,QAAb,EAAuBmC,IAAvB;AACD;;AAED,cAAIF,SAAJ,EAAe;AACbE,iBAAKF,SAAL;AACD;AACF,SAXM,CAAP;AAYD;AAtGkB;;AAAA;AAAA;;AAyGrB;;;;;AAKAnC,IAAEK,EAAF,CAAKJ,IAAL,IAAaF,OAAOuC,gBAApB;AACAtC,IAAEK,EAAF,CAAKJ,IAAL,EAAWsC,WAAX,GAAyBxC,MAAzB;AACAC,IAAEK,EAAF,CAAKJ,IAAL,EAAWuC,UAAX,GAAwB,YAAY;AAClCxC,MAAEK,EAAF,CAAKJ,IAAL,IAAaG,kBAAb;AACA,WAAOL,OAAOuC,gBAAd;AACD,GAHD;;AAKA,SAAOvC,MAAP;AAED,CAvHc,CAuHZ0C,MAvHY,CAAf","file":"Layout.js","sourcesContent":["/**\n * --------------------------------------------\n * AdminLTE Layout.js\n * License MIT\n * --------------------------------------------\n */\n\nconst Layout = (($) => {\n 'use strict'\n\n /**\n * Constants\n * ====================================================\n */\n\n const NAME = 'Layout'\n const DATA_KEY = 'lte.layout'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Event = {\n SIDEBAR: 'sidebar'\n }\n\n const Selector = {\n SIDEBAR: '.main-sidebar',\n HEADER: '.main-header',\n CONTENT: '.content-wrapper',\n CONTENT_HEADER: '.content-header',\n WRAPPER: '.wrapper',\n CONTROL_SIDEBAR: '.control-sidebar',\n LAYOUT_FIXED: '.layout-fixed',\n FOOTER: '.main-footer'\n }\n\n const ClassName = {\n HOLD: 'hold-transition',\n SIDEBAR: 'main-sidebar',\n LAYOUT_FIXED: 'layout-fixed'\n }\n\n /**\n * Class Definition\n * ====================================================\n */\n\n class Layout {\n\n constructor(element) {\n this._element = element\n\n this._init()\n }\n\n // Public\n\n fixLayoutHeight() {\n let heights = [\n $(window).height(),\n $(Selector.HEADER).outerHeight(),\n $(Selector.FOOTER).outerHeight(),\n $(Selector.SIDEBAR).height()\n ],\n max = this._max(heights)\n\n $(Selector.CONTENT).css('min-height', max - (heights[1] + heights[2]))\n }\n\n // Private\n\n _init() {\n $('body').removeClass(ClassName.HOLD)\n\n this.fixLayoutHeight()\n $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', () => {\n this.fixLayoutHeight()\n })\n $(window).resize(() => {\n this.fixLayoutHeight()\n })\n }\n\n _max(numbers) {\n let max = 0\n\n numbers.forEach((v) => {\n if (v > max) {\n max = v\n }\n })\n\n return max\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 Layout(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (operation) {\n data[operation]()\n }\n })\n }\n }\n\n /**\n * jQuery API\n * ====================================================\n */\n\n $.fn[NAME] = Layout._jQueryInterface\n $.fn[NAME].Constructor = Layout\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Layout._jQueryInterface\n }\n\n return Layout\n\n})(jQuery)\n"]} \ No newline at end of file diff --git a/build/js/src/Layout.js b/build/js/src/Layout.js index 81cb540b7..1355504c8 100644 --- a/build/js/src/Layout.js +++ b/build/js/src/Layout.js @@ -13,9 +13,9 @@ const Layout = (($) => { * ==================================================== */ - const NAME = 'Layout' - const DATA_KEY = 'lte.layout' - const EVENT_KEY = `.${DATA_KEY}` + const NAME = 'Layout' + const DATA_KEY = 'lte.layout' + const EVENT_KEY = `.${DATA_KEY}` const JQUERY_NO_CONFLICT = $.fn[NAME] const Event = { @@ -56,13 +56,14 @@ const Layout = (($) => { fixLayoutHeight() { let heights = [ - $(window).height(), - $(Selector.HEADER).outerHeight(), - $(Selector.FOOTER).outerHeight() - ] - - $(Selector.CONTENT).css('min-height', heights[0] - (heights[1] + heights[2])) - console.log(heights[0] - (heights[1] + heights[2])) + $(window).height(), + $(Selector.HEADER).outerHeight(), + $(Selector.FOOTER).outerHeight(), + $(Selector.SIDEBAR).height() + ], + max = this._max(heights) + + $(Selector.CONTENT).css('min-height', max - (heights[1] + heights[2])) } // Private @@ -71,7 +72,7 @@ const Layout = (($) => { $('body').removeClass(ClassName.HOLD) this.fixLayoutHeight() - $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview', () => { + $(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', () => { this.fixLayoutHeight() }) $(window).resize(() => { @@ -116,7 +117,7 @@ const Layout = (($) => { $.fn[NAME] = Layout._jQueryInterface $.fn[NAME].Constructor = Layout - $.fn[NAME].noConflict = function () { + $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT return Layout._jQueryInterface }