Skip to content
Permalink
Browse files

Merge pull request #2256 from REJack/v3-dev

first changes after v3.0.0-rc.1
  • Loading branch information...
REJack committed Oct 2, 2019
2 parents 07720d6 + 0997ace commit 9dc6d1dfd3f11697a27d89d89389d66cbec2d64e
Showing 436 changed files with 37,773 additions and 17,633 deletions.
@@ -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

@@ -0,0 +1,3 @@
/docs/
/plugins/
!/plugins/flot-old/
@@ -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,
@@ -17,5 +18,6 @@ export {
TodoList,
CardWidget,
CardRefresh,
Dropdown
Dropdown,
Toasts
}
@@ -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 = {
@@ -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 = {
@@ -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,
@@ -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)
@@ -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) {
@@ -23,7 +23,6 @@ const PushMenu = (($) => {

const Default = {
autoCollapseSize: false,
screenCollapseSize: 768,
enableRemember: false,
noTransitionAfterReload: true
}
@@ -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'
}

/**
@@ -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
@@ -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)
@@ -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()
@@ -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()
}
}
@@ -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)
}
}
}

0 comments on commit 9dc6d1d

Please sign in to comment.
You can’t perform that action at this time.