Skip to content

Commit 2226c0e

Browse files
committed
fixed drag and drop breaking adminlte's design
- updated ControlSidebar.js to hide control sidebar instead of only moving it - updated dashboard.js to use containment in sortable() - added display none to control sidebar content in index.html (Closes #1924)
1 parent 3254b3b commit 2226c0e

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

build/js/ControlSidebar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,20 @@
7171
};
7272

7373
ControlSidebar.prototype.expand = function () {
74+
$(Selector.sidebar).show();
7475
if (!this.options.slide) {
7576
$('body').addClass(ClassName.open);
7677
} else {
7778
$(Selector.sidebar).addClass(ClassName.open);
7879
}
7980

81+
8082
$(this.element).trigger($.Event(Event.expanded));
8183
};
8284

8385
ControlSidebar.prototype.collapse = function () {
8486
$('body, ' + Selector.sidebar).removeClass(ClassName.open);
87+
$(Selector.sidebar).fadeOut();
8588
$(this.element).trigger($.Event(Event.collapsed));
8689
};
8790

dist/js/adminlte.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,17 +389,20 @@ throw new Error('AdminLTE requires jQuery')
389389
};
390390

391391
ControlSidebar.prototype.expand = function () {
392+
$(Selector.sidebar).show();
392393
if (!this.options.slide) {
393394
$('body').addClass(ClassName.open);
394395
} else {
395396
$(Selector.sidebar).addClass(ClassName.open);
396397
}
397398

399+
398400
$(this.element).trigger($.Event(Event.expanded));
399401
};
400402

401403
ControlSidebar.prototype.collapse = function () {
402404
$('body, ' + Selector.sidebar).removeClass(ClassName.open);
405+
$(Selector.sidebar).fadeOut();
403406
$(this.element).trigger($.Event(Event.collapsed));
404407
};
405408

dist/js/adminlte.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/pages/dashboard.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ $(function () {
1111

1212
// Make the dashboard widgets sortable Using jquery UI
1313
$('.connectedSortable').sortable({
14+
containment : $('section.content'),
1415
placeholder : 'sort-highlight',
1516
connectWith : '.connectedSortable',
1617
handle : '.box-header, .nav-tabs',

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ <h3 class="box-title">Calendar</h3>
10351035
</footer>
10361036

10371037
<!-- Control Sidebar -->
1038-
<aside class="control-sidebar control-sidebar-dark">
1038+
<aside class="control-sidebar control-sidebar-dark" style="display: none;">
10391039
<!-- Create the tabs -->
10401040
<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
10411041
<li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>

0 commit comments

Comments
 (0)