Skip to content

Commit b7cb209

Browse files
committed
add js trick
1 parent d5dbf20 commit b7cb209

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

engines/admin-lte/views/_namespace_/_name_/app.blade.php

+22-3
Original file line numberDiff line numberDiff line change
@@ -627,23 +627,42 @@ class="img-circle"
627627

628628

629629
<script type="text/javascript">
630+
var AdminLTEOptions = {
631+
animationSpeed: 100
632+
};
633+
630634
jQuery(function () {
635+
631636
var sidebar = $("#sidebar");
632637
var wrapper = $(window, ".wrapper");
633638
634639
sidebar.find('li').click(function () {
635640
var siblings = $(this).siblings();
636641
siblings.find('>ul').hide();
637-
siblings.removeClass('active');
638-
$(this).addClass('active');
642+
siblings.removeClass('active menu-open');
643+
$(this).addClass('active menu-open');
639644
640645
setTimeout(function () {
641646
wrapper.trigger('resize');
642647
});
643648
});
644649
645-
sidebar.find('a.active').first().parents('li').addClass('active menu-open');
650+
var activeLi = sidebar.find('a.active').first();
651+
activeLi.parents('li').addClass('active menu-open').show();
652+
activeLi.parents('ul').show();
653+
654+
function updateWidth() {
655+
var w = $(window);
656+
var body = $('body');
657+
body.css({width: w.width()});
658+
$('.main-header').css({width: w.width()});
659+
}
660+
661+
setTimeout(updateWidth);
662+
663+
$(window).on('resize', updateWidth);
646664
});
665+
647666
</script>
648667

649668
</body>

0 commit comments

Comments
 (0)