1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

[help, system admin] redesigned 'side nav' for mobile

This commit is contained in:
llj
2019-06-19 10:36:22 +08:00
parent 2e3b68f947
commit c382e06099
6 changed files with 109 additions and 27 deletions

View File

@@ -2,8 +2,9 @@ define([
'jquery',
'underscore',
'backbone',
'common'
], function($, _, Backbone, Common) {
'common',
'simplemodal'
], function($, _, Backbone, Common, Simplemodal) {
'use strict';
var sideNavView = Backbone.View.extend({
@@ -26,6 +27,8 @@ define([
$(window).on('resize', function() {
if ($(window).width() >= 768) {
_this.show();
} else {
_this.hide();
}
});
},
@@ -44,11 +47,25 @@ define([
},
show: function() {
var _this = this;
this.$el.css({ 'left':'0px' });
if ($(window).width() < 768) {
$('').modal({
overlayClose: true,
onClose: function() {
_this.hide();
}});
$('#simplemodal-container').css({'display':'none'});
} else {
$.modal.close();
}
},
hide: function() {
this.$el.css({ 'left':'-300px' });
if ($(window).width() < 768) {
$.modal.close();
}
},
events: {