Skip to content

Commit 9dc6d1d

Browse files
authored
Merge pull request #2256 from REJack/v3-dev
first changes after v3.0.0-rc.1
2 parents 07720d6 + 0997ace commit 9dc6d1d

File tree

436 files changed

+37773
-17633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

436 files changed

+37773
-17633
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@ nbproject/private
1919
node_modules/
2020
bower_components/
2121

22+
// Plugins
23+
/plugins/*/*.md
24+
/plugins/*/*.html
25+
/plugins/*/package.json
26+
27+
2228
// Docs
2329
Gemfile.lock
2430
docs/_site
31+
docs_html/
2532
.jekyll-cache/
2633
.jekyll-metadata
2734

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/docs/
2+
/plugins/
3+
!/plugins/flot-old/

build/js/AdminLTE.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import TodoList from './TodoList'
77
import CardWidget from './CardWidget'
88
import CardRefresh from './CardRefresh'
99
import Dropdown from './Dropdown'
10+
import Toasts from './Toasts'
1011

1112
export {
1213
ControlSidebar,
@@ -17,5 +18,6 @@ export {
1718
TodoList,
1819
CardWidget,
1920
CardRefresh,
20-
Dropdown
21+
Dropdown,
22+
Toasts
2123
}

build/js/Layout.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const Layout = (($) => {
3030
WRAPPER : '.wrapper',
3131
CONTROL_SIDEBAR: '.control-sidebar',
3232
LAYOUT_FIXED : '.layout-fixed',
33-
FOOTER : '.main-footer'
33+
FOOTER : '.main-footer',
34+
LOGIN_BOX : '.login-box',
35+
REGISTER_BOX : '.register-box'
3436
}
3537

3638
const ClassName = {
@@ -41,6 +43,8 @@ const Layout = (($) => {
4143
LAYOUT_FIXED : 'layout-fixed',
4244
NAVBAR_FIXED : 'layout-navbar-fixed',
4345
FOOTER_FIXED : 'layout-footer-fixed',
46+
LOGIN_PAGE : 'login-page',
47+
REGISTER_PAGE : 'register-page',
4448
}
4549

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

6670
fixLayoutHeight() {
6771
const heights = {
68-
window : $(window).height(),
69-
header : $(Selector.HEADER).outerHeight(),
70-
footer : $(Selector.FOOTER).outerHeight(),
71-
sidebar : $(Selector.SIDEBAR).height(),
72+
window: $(window).height(),
73+
header: $(Selector.HEADER).length !== 0 ? $(Selector.HEADER).outerHeight() : 0,
74+
footer: $(Selector.FOOTER).length !== 0 ? $(Selector.FOOTER).outerHeight() : 0,
75+
sidebar: $(Selector.SIDEBAR).length !== 0 ? $(Selector.SIDEBAR).height() : 0,
7276
}
7377

7478
const max = this._max(heights)
7579

76-
80+
$(Selector.CONTENT).css('min-height', max - heights.footer)
81+
7782
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
78-
$(Selector.CONTENT).css('min-height', max - heights.header - heights.footer)
79-
// $(Selector.SIDEBAR).css('min-height', max - heights.header)
80-
8183
if (typeof $.fn.overlayScrollbars !== 'undefined') {
8284
$(Selector.SIDEBAR).overlayScrollbars({
8385
className : this._config.scrollbarTheme,
@@ -88,21 +90,12 @@ const Layout = (($) => {
8890
}
8991
})
9092
}
91-
} else {
92-
if (heights.window > heights.sidebar) {
93-
$(Selector.CONTENT).css('min-height', heights.window - heights.header - heights.footer)
94-
} else {
95-
$(Selector.CONTENT).css('min-height', heights.sidebar - heights.header)
96-
}
9793
}
9894
}
9995

10096
// Private
10197

10298
_init() {
103-
// Enable transitions
104-
$('body').removeClass(ClassName.HOLD)
105-
10699
// Activate layout height watcher
107100
this.fixLayoutHeight()
108101
$(Selector.SIDEBAR)
@@ -114,7 +107,15 @@ const Layout = (($) => {
114107
this.fixLayoutHeight()
115108
})
116109

117-
$('body, html').css('height', 'auto')
110+
if (!$('body').hasClass(ClassName.LOGIN_PAGE) && !$('body').hasClass(ClassName.REGISTER_PAGE)) {
111+
$('body, html').css('height', 'auto')
112+
} else if ($('body').hasClass(ClassName.LOGIN_PAGE) || $('body').hasClass(ClassName.REGISTER_PAGE)) {
113+
let box_height = $(Selector.LOGIN_BOX + ', ' + Selector.REGISTER_BOX).height()
114+
115+
$('body').css('min-height', box_height);
116+
}
117+
118+
$('body.hold-transition').removeClass('hold-transition')
118119
}
119120

120121
_max(numbers) {

build/js/PushMenu.js

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const PushMenu = (($) => {
2323

2424
const Default = {
2525
autoCollapseSize: false,
26-
screenCollapseSize: 768,
2726
enableRemember: false,
2827
noTransitionAfterReload: true
2928
}
@@ -40,8 +39,7 @@ const PushMenu = (($) => {
4039
const ClassName = {
4140
SIDEBAR_OPEN: 'sidebar-open',
4241
COLLAPSED: 'sidebar-collapse',
43-
OPEN: 'sidebar-open',
44-
SIDEBAR_MINI: 'sidebar-mini'
42+
OPEN: 'sidebar-open'
4543
}
4644

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

57-
this._init()
55+
56+
if (!$(Selector.BODY).hasClass(ClassName.COLLAPSED) && !$(Selector.BODY).hasClass(ClassName.OPEN)) {
57+
$(Selector.BODY).addClass(ClassName.OPEN)
58+
}
5859

5960
if (!$(Selector.OVERLAY).length) {
6061
this._addOverlay()
6162
}
63+
64+
this._init()
6265
}
6366

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

6972
if(this._options.enableRemember) {
70-
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN);
73+
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
7174
}
7275

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

8083
if(this._options.enableRemember) {
81-
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED);
84+
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)
8285
}
8386

8487
const collapsedEvent = $.Event(Event.COLLAPSED)
8588
$(this._element).trigger(collapsedEvent)
8689
}
8790

88-
isShown() {
89-
if ($(window).width() >= this._options.screenCollapseSize) {
90-
return !$(Selector.BODY).hasClass(ClassName.COLLAPSED)
91-
} else {
92-
return $(Selector.BODY).hasClass(ClassName.OPEN)
93-
}
94-
}
95-
9691
toggle() {
97-
if (this.isShown()) {
92+
if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
9893
this.collapse()
9994
} else {
10095
this.show()
@@ -104,11 +99,11 @@ const PushMenu = (($) => {
10499
autoCollapse() {
105100
if (this._options.autoCollapseSize) {
106101
if ($(window).width() <= this._options.autoCollapseSize) {
107-
if (this.isShown()) {
102+
if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
108103
this.toggle()
109104
}
110105
} else {
111-
if (!this.isShown()) {
106+
if (!$(Selector.BODY).hasClass(ClassName.OPEN)) {
112107
this.toggle()
113108
}
114109
}
@@ -117,15 +112,24 @@ const PushMenu = (($) => {
117112

118113
remember() {
119114
if(this._options.enableRemember) {
120-
var toggleState = localStorage.getItem(`remember${EVENT_KEY}`);
115+
let toggleState = localStorage.getItem(`remember${EVENT_KEY}`)
121116
if (toggleState == ClassName.COLLAPSED){
122117
if (this._options.noTransitionAfterReload) {
123-
$("body").addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(10).queue(function() {
124-
$(this).removeClass('hold-transition');
118+
$("body").addClass('hold-transition').addClass(ClassName.COLLAPSED).delay(50).queue(function() {
119+
$(this).removeClass('hold-transition')
120+
$(this).dequeue()
121+
})
122+
} else {
123+
$("body").addClass(ClassName.COLLAPSED)
124+
}
125+
} else {
126+
if (this._options.noTransitionAfterReload) {
127+
$("body").addClass('hold-transition').removeClass(ClassName.COLLAPSED).delay(50).queue(function() {
128+
$(this).removeClass('hold-transition')
125129
$(this).dequeue()
126-
});
130+
})
127131
} else {
128-
$("body").addClass(ClassName.COLLAPSED);
132+
$("body").removeClass(ClassName.COLLAPSED)
129133
}
130134
}
131135
}

0 commit comments

Comments
 (0)