1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

Merge pull request #1491 from haiwen/mobile-side-nav

[mobile] side nav: modified for sysadmin-backbone pages & all non-bac…
This commit is contained in:
Daniel Pan
2017-02-17 22:55:12 +08:00
committed by GitHub
10 changed files with 57 additions and 3 deletions

View File

@@ -17,7 +17,17 @@ define([
'cur_tab': this.default_cur_tab
};
this.render();
this.$el.show();
var _this = this;
$('#js-toggle-side-nav').click(function() {
_this.show();
return false;
});
$(window).resize(function() {
if ($(window).width() >= 768) {
_this.show();
}
});
},
render: function() {
@@ -33,12 +43,34 @@ define([
this.render();
},
show: function() {
this.$el.css({ 'left':'0px' });
},
hide: function() {
this.$el.css({ 'left':'-300px' });
},
events: {
'click .js-close-side-nav': 'closeNav',
'click li a': 'visitLink',
'submit #libs-search-form': 'searchLibs', // for 'all' libs
'submit #trash-libs-search-form': 'searchTrashLibs',
'submit #groups-search-form': 'searchGroups'
},
closeNav: function() {
this.hide();
return false;
},
visitLink: function(e) {
if ($(window).width() < 768) {
this.hide();
}
return true;
},
// search libs by repo_name
searchLibs: function() {
var $form = this.$('#libs-search-form');