Skip to content

Commit

Permalink
Merge pull request #2256 from REJack/v3-dev
Browse files Browse the repository at this point in the history
first changes after v3.0.0-rc.1
  • Loading branch information
REJack committed Oct 2, 2019
2 parents 07720d6 + 0997ace commit 9dc6d1d
Show file tree
Hide file tree
Showing 436 changed files with 37,773 additions and 17,633 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ nbproject/private
node_modules/ node_modules/
bower_components/ bower_components/


// Plugins
/plugins/*/*.md
/plugins/*/*.html
/plugins/*/package.json


// Docs // Docs
Gemfile.lock Gemfile.lock
docs/_site docs/_site
docs_html/
.jekyll-cache/ .jekyll-cache/
.jekyll-metadata .jekyll-metadata


Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
/docs/
/plugins/
!/plugins/flot-old/
4 changes: 3 additions & 1 deletion build/js/AdminLTE.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import TodoList from './TodoList'
import CardWidget from './CardWidget' import CardWidget from './CardWidget'
import CardRefresh from './CardRefresh' import CardRefresh from './CardRefresh'
import Dropdown from './Dropdown' import Dropdown from './Dropdown'
import Toasts from './Toasts'


export { export {
ControlSidebar, ControlSidebar,
Expand All @@ -17,5 +18,6 @@ export {
TodoList, TodoList,
CardWidget, CardWidget,
CardRefresh, CardRefresh,
Dropdown Dropdown,
Toasts
} }
39 changes: 20 additions & 19 deletions build/js/Layout.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const Layout = (($) => {
WRAPPER : '.wrapper', WRAPPER : '.wrapper',
CONTROL_SIDEBAR: '.control-sidebar', CONTROL_SIDEBAR: '.control-sidebar',
LAYOUT_FIXED : '.layout-fixed', LAYOUT_FIXED : '.layout-fixed',
FOOTER : '.main-footer' FOOTER : '.main-footer',
LOGIN_BOX : '.login-box',
REGISTER_BOX : '.register-box'
} }


const ClassName = { const ClassName = {
Expand All @@ -41,6 +43,8 @@ const Layout = (($) => {
LAYOUT_FIXED : 'layout-fixed', LAYOUT_FIXED : 'layout-fixed',
NAVBAR_FIXED : 'layout-navbar-fixed', NAVBAR_FIXED : 'layout-navbar-fixed',
FOOTER_FIXED : 'layout-footer-fixed', FOOTER_FIXED : 'layout-footer-fixed',
LOGIN_PAGE : 'login-page',
REGISTER_PAGE : 'register-page',
} }


const Default = { const Default = {
Expand All @@ -65,19 +69,17 @@ const Layout = (($) => {


fixLayoutHeight() { fixLayoutHeight() {
const heights = { const heights = {
window : $(window).height(), window: $(window).height(),
header : $(Selector.HEADER).outerHeight(), header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
footer : $(Selector.FOOTER).outerHeight(), footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
sidebar : $(Selector.SIDEBAR).height(), sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
} }


const max = this._max(heights) const max = this._max(heights)



$(Selector.CONTENT).css('min-height', max - heights.footer)

if ($('body').hasClass(ClassName.LAYOUT_FIXED)) { if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
$(Selector.CONTENT).css('min-height', max - heights.header - heights.footer)
// $(Selector.SIDEBAR).css('min-height', max - heights.header)

if (typeof $.fn.overlayScrollbars !== 'undefined') { if (typeof $.fn.overlayScrollbars !== 'undefined') {
$(Selector.SIDEBAR).overlayScrollbars({ $(Selector.SIDEBAR).overlayScrollbars({
className : this._config.scrollbarTheme, className : this._config.scrollbarTheme,
Expand All @@ -88,21 +90,12 @@ const Layout = (($) => {
} }
}) })
} }
} 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 // Private


_init() { _init() {
// Enable transitions
$('body').removeClass(ClassName.HOLD)

// Activate layout height watcher // Activate layout height watcher
this.fixLayoutHeight() this.fixLayoutHeight()
$(Selector.SIDEBAR) $(Selector.SIDEBAR)
Expand All @@ -114,7 +107,15 @@ const Layout = (($) => {
this.fixLayoutHeight() this.fixLayoutHeight()
}) })


$('body, html').css('height', 'auto') if (!$('body').hasClass(ClassName.LOGIN_PAGE) && !$('body').hasClass(ClassName.REGISTER_PAGE)) {
$('body, html').css('height', 'auto')
} else if ($('body').hasClass(ClassName.LOGIN_PAGE) || $('body').hasClass(ClassName.REGISTER_PAGE)) {
let box_height = $(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).height()

$('body').css('min-height', box_height);
}

$('body.hold-transition').removeClass('hold-transition')
} }


_max(numbers) { _max(numbers) {
Expand Down
48 changes: 26 additions & 22 deletions build/js/PushMenu.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const PushMenu = (($) => {


const Default = { const Default = {
autoCollapseSize: false, autoCollapseSize: false,
screenCollapseSize: 768,
enableRemember: false, enableRemember: false,
noTransitionAfterReload: true noTransitionAfterReload: true
} }
Expand All @@ -40,8 +39,7 @@ const PushMenu = (($) => {
const ClassName = { const ClassName = {
SIDEBAR_OPEN: 'sidebar-open', SIDEBAR_OPEN: 'sidebar-open',
COLLAPSED: 'sidebar-collapse', COLLAPSED: 'sidebar-collapse',
OPEN: 'sidebar-open', OPEN: 'sidebar-open'
SIDEBAR_MINI: 'sidebar-mini'
} }


/** /**
Expand All @@ -54,11 +52,16 @@ const PushMenu = (($) => {
this._element = element this._element = element
this._options = $.extend({}, Default, options) this._options = $.extend({}, Default, options)


this._init()
if (!$(Selector.BODY).hasClass(ClassName.COLLAPSED) && !$(Selector.BODY).hasClass(ClassName.OPEN)) {
$(Selector.BODY).addClass(ClassName.OPEN)
}


if (!$(Selector.OVERLAY).length) { if (!$(Selector.OVERLAY).length) {
this._addOverlay() this._addOverlay()
} }

this._init()
} }


// Public // Public
Expand All @@ -67,7 +70,7 @@ const PushMenu = (($) => {
$(Selector.BODY).addClass(ClassName.OPEN).removeClass(ClassName.COLLAPSED) $(Selector.BODY).addClass(ClassName.OPEN).removeClass(ClassName.COLLAPSED)


if(this._options.enableRemember) { if(this._options.enableRemember) {
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN); localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
} }


const shownEvent = $.Event(Event.SHOWN) const shownEvent = $.Event(Event.SHOWN)
Expand All @@ -78,23 +81,15 @@ const PushMenu = (($) => {
$(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.COLLAPSED) $(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.COLLAPSED)


if(this._options.enableRemember) { if(this._options.enableRemember) {
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED); localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
} }


const collapsedEvent = $.Event(Event.COLLAPSED) const collapsedEvent = $.Event(Event.COLLAPSED)
$(this._element).trigger(collapsedEvent) $(this._element).trigger(collapsedEvent)
} }


isShown() {
if ($(window).width() >= this._options.screenCollapseSize) {
return !$(Selector.BODY).hasClass(ClassName.COLLAPSED)
} else {
return $(Selector.BODY).hasClass(ClassName.OPEN)
}
}

toggle() { toggle() {
if (this.isShown()) { if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
this.collapse() this.collapse()
} else { } else {
this.show() this.show()
Expand All @@ -104,11 +99,11 @@ const PushMenu = (($) => {
autoCollapse() { autoCollapse() {
if (this._options.autoCollapseSize) { if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) { if ($(window).width() <= this._options.autoCollapseSize) {
if (this.isShown()) { if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
this.toggle() this.toggle()
} }
} else { } else {
if (!this.isShown()) { if (!$(Selector.BODY).hasClass(ClassName.OPEN)) {
this.toggle() this.toggle()
} }
} }
Expand All @@ -117,15 +112,24 @@ const PushMenu = (($) => {


remember() { remember() {
if(this._options.enableRemember) { if(this._options.enableRemember) {
var toggleState = localStorage.getItem(`remember${EVENT_KEY}`); let toggleState = localStorage.getItem(`remember${EVENT_KEY}`)
if (toggleState == ClassName.COLLAPSED){ if (toggleState == ClassName.COLLAPSED){
if (this._options.noTransitionAfterReload) { if (this._options.noTransitionAfterReload) {
$("body").addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(10).queue(function() { $("body").addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(50).queue(function() {
$(this).removeClass('hold-transition'); $(this).removeClass('hold-transition')
$(this).dequeue()
})
} else {
$("body").addClass(ClassName.COLLAPSED)
}
} else {
if (this._options.noTransitionAfterReload) {
$("body").addClass('hold-transition').removeClass(ClassName.COLLAPSED).delay(50).queue(function() {
$(this).removeClass('hold-transition')
$(this).dequeue() $(this).dequeue()
}); })
} else { } else {
$("body").addClass(ClassName.COLLAPSED); $("body").removeClass(ClassName.COLLAPSED)
} }
} }
} }
Expand Down
Loading

0 comments on commit 9dc6d1d

Please sign in to comment.