mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-31 07:18:21 -04:00
Update layout.
This commit is contained in:
parent
b390b9fc42
commit
60b81a46ea
29 changed files with 136 additions and 355 deletions
|
@ -9,7 +9,7 @@ modulejs.define('view/sidebar', ['$', 'core/resource', 'core/store'], function (
|
|||
'</li>';
|
||||
|
||||
|
||||
function update(toggle, animate) {
|
||||
function update(toggle) {
|
||||
|
||||
var $toggle = $('#sidebar-toggle');
|
||||
var $sidebar = $('#sidebar');
|
||||
|
@ -22,32 +22,24 @@ modulejs.define('view/sidebar', ['$', 'core/resource', 'core/store'], function (
|
|||
|
||||
if (isVisible) {
|
||||
$toggle.addClass('current');
|
||||
$sidebar.show();
|
||||
} else {
|
||||
$toggle.removeClass('current');
|
||||
}
|
||||
|
||||
if (animate) {
|
||||
$sidebar.stop().animate({
|
||||
right: isVisible ? 0 : -$sidebar.outerWidth()-1
|
||||
});
|
||||
} else {
|
||||
$sidebar.css({
|
||||
right: store.get(storekey) ? 0 : -$sidebar.outerWidth()-1
|
||||
});
|
||||
$sidebar.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
$(toggleTemplate)
|
||||
.appendTo('#navbar')
|
||||
.on('click', 'a', function (ev) {
|
||||
|
||||
update(true, true);
|
||||
update(true);
|
||||
ev.preventDefault();
|
||||
})
|
||||
.appendTo('#navbar');
|
||||
});
|
||||
|
||||
update(false, false);
|
||||
update(false);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue