Improve menu.
This commit is contained in:
parent
1d24b7131f
commit
fcecdb26e9
2 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
## develop
|
## develop
|
||||||
|
|
||||||
|
* improves menu
|
||||||
* adds editorconfig
|
* adds editorconfig
|
||||||
* updates build process, now uses [mkr](http://larsjung.de/mkr/) and [fQuery](http://larsjung.de/fquery/)
|
* updates build process, now uses [mkr](http://larsjung.de/mkr/) and [fQuery](http://larsjung.de/fquery/)
|
||||||
* updates `modulejs` to 1.0.0
|
* updates `modulejs` to 1.0.0
|
||||||
|
|
|
@ -7,6 +7,7 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||||
sizes: sizes
|
sizes: sizes
|
||||||
}, allsettings.view);
|
}, allsettings.view);
|
||||||
var storekey = 'viewmode';
|
var storekey = 'viewmode';
|
||||||
|
var storekeyMenu = 'menuIsVisible';
|
||||||
var menuIsVisible = false;
|
var menuIsVisible = false;
|
||||||
var sidebarToggleTemplate =
|
var sidebarToggleTemplate =
|
||||||
'<li id="menu-toggle" class="view">' +
|
'<li id="menu-toggle" class="view">' +
|
||||||
|
@ -77,7 +78,9 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||||
$(sidebarToggleTemplate)
|
$(sidebarToggleTemplate)
|
||||||
.on('click', 'a', function (event) {
|
.on('click', 'a', function (event) {
|
||||||
|
|
||||||
|
var menuIsVisible = store.get(storekeyMenu);
|
||||||
menuIsVisible = !menuIsVisible;
|
menuIsVisible = !menuIsVisible;
|
||||||
|
store.put(storekeyMenu, menuIsVisible);
|
||||||
$sidebar.stop().animate({
|
$sidebar.stop().animate({
|
||||||
right: menuIsVisible ? 0 : -$sidebar.outerWidth()-1
|
right: menuIsVisible ? 0 : -$sidebar.outerWidth()-1
|
||||||
});
|
});
|
||||||
|
@ -116,6 +119,10 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
$sidebar.css({
|
||||||
|
right: store.get(storekeyMenu) ? 0 : -$sidebar.outerWidth()-1
|
||||||
|
});
|
||||||
|
|
||||||
event.sub('location.changed', adjustSpacing);
|
event.sub('location.changed', adjustSpacing);
|
||||||
$(window).on('resize', adjustSpacing);
|
$(window).on('resize', adjustSpacing);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue