Skip to content

Commit

Permalink
improvement: partly auto hide left menu panel on viewport width less …
Browse files Browse the repository at this point in the history
…than 900px (LMS #1420)
  • Loading branch information
chilek committed Oct 11, 2018
1 parent 5375673 commit 26b00bb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ TABLE { border-collapse: collapse; border-color: #000000 }
align-items: center;
}

@media all and (max-width: 900px) {
#lms-ui-menu-panel {
min-width: unset;
width: 3em;
--lms-mobile: 1;
}
}

#lms-ui-menu-panel-toggle {
position: absolute;
left: 0.15em;
Expand Down
24 changes: 24 additions & 0 deletions templates/default/menu-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,28 @@
var menuPanelContainer = $('#lms-ui-menu-panel-container');
menuPanelContainer.css('margin-right', menuPanelContainer[0].clientWidth - menuPanelContainer[0].offsetWidth + 'px');


$(function() {
$('#lms-ui-menu-panel').on('mouseenter touchstart', function () {
if ($('#lms-ui-menu-panel').css('--lms-mobile')) {
$(this).animate({
width: '12em'
});
}
}).on('mouseleave', function () {
if ($('#lms-ui-menu-panel').css('--lms-mobile')) {
$(this).animate({
width: '3em'
});
}
});
$('#lms-ui-contents').on('mouseenter touchstart', function () {
if ($('#lms-ui-menu-panel').css('--lms-mobile')) {
$('#lms-ui-menu-panel').animate({
width: '3em'
});
}
});
});

</script>

0 comments on commit 26b00bb

Please sign in to comment.