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 Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ nbproject/private
node_modules/
bower_components/

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


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

Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number 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 Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import TodoList from './TodoList'
import CardWidget from './CardWidget'
import CardRefresh from './CardRefresh'
import Dropdown from './Dropdown'
import Toasts from './Toasts'

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

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

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

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

const max = this._max(heights)


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

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') {
$(Selector.SIDEBAR).overlayScrollbars({
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

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

// Activate layout height watcher
this.fixLayoutHeight()
$(Selector.SIDEBAR)
Expand All @@ -114,7 +107,15 @@ const Layout = (($) => {
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) {
Expand Down
48 changes: 26 additions & 22 deletions build/js/PushMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const PushMenu = (($) => {

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

/**
Expand All @@ -54,11 +52,16 @@ const PushMenu = (($) => {
this._element = element
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) {
this._addOverlay()
}

this._init()
}

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

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

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

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

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

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

0 comments on commit 9dc6d1d

Please sign in to comment.