mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +00:00
first : modify the editor to be resposed for pc and mobile;
second: change the editor menu style for different device;
This commit is contained in:
@@ -80,7 +80,7 @@ define([
|
||||
el: this.$('.sf-dropdown'),
|
||||
right: '0'
|
||||
});
|
||||
|
||||
this.mobileMenu = this.$(".mobile-menu-container");
|
||||
// for image files
|
||||
this.$('.img-name-link').magnificPopup(this.dirView.magnificPopupOptions);
|
||||
|
||||
@@ -114,7 +114,10 @@ define([
|
||||
'click .unlock-file': 'unlockFile',
|
||||
'click .view-details': 'viewDetails',
|
||||
'click .file-comment': 'viewFileComments',
|
||||
'click .open-via-client': 'open_via_client'
|
||||
'click .open-via-client': 'open_via_client',
|
||||
'click .mobile-menu-control': 'showMobileMenu',
|
||||
'click .mobile-menu-mask': 'closeMobileMenu',
|
||||
'click .download-close-menu': 'hideMobileMenu'
|
||||
},
|
||||
|
||||
getSmartLink: function() {
|
||||
@@ -358,6 +361,7 @@ define([
|
||||
if ($(window).width() < 768 &&
|
||||
!this.model.get('is_img')) { // dir or non image file
|
||||
location.href = this.$('.dirent-name a').attr('href');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -367,6 +371,7 @@ define([
|
||||
},
|
||||
|
||||
share: function() {
|
||||
this.hideMobileMenu();
|
||||
var dir = this.dir,
|
||||
obj_name = this.model.get('obj_name'),
|
||||
dirent_path = Common.pathJoin([dir.path, obj_name]);
|
||||
@@ -392,6 +397,7 @@ define([
|
||||
},
|
||||
|
||||
del: function() {
|
||||
this.hideMobileMenu();
|
||||
var _this = this;
|
||||
if (this.model.get('is_img')) {
|
||||
var index = $('.img-name-link', this.dirView.$table).index(this.$('.img-name-link'));
|
||||
@@ -418,6 +424,7 @@ define([
|
||||
},
|
||||
|
||||
rename: function() {
|
||||
this.hideMobileMenu();
|
||||
var _this = this;
|
||||
var dirent_name = this.model.get('obj_name');
|
||||
|
||||
@@ -532,6 +539,7 @@ define([
|
||||
},
|
||||
|
||||
mvcp: function(e) {
|
||||
this.hideMobileMenu();
|
||||
var op_type = $(e.currentTarget).hasClass('mv') ? 'mv' : 'cp';
|
||||
var options = {
|
||||
'dir': this.dir,
|
||||
@@ -552,6 +560,7 @@ define([
|
||||
},
|
||||
|
||||
setFolderPerm: function() {
|
||||
this.hideMobileMenu();
|
||||
var options = {
|
||||
'obj_name': this.model.get('obj_name'),
|
||||
'dir_path': this.dir.path,
|
||||
@@ -567,6 +576,7 @@ define([
|
||||
},
|
||||
|
||||
lockFile: function() {
|
||||
this.hideMobileMenu();
|
||||
var _this = this;
|
||||
this._hideMenu();
|
||||
this.model.lockFile({
|
||||
@@ -581,6 +591,7 @@ define([
|
||||
},
|
||||
|
||||
unlockFile: function() {
|
||||
this.hideMobileMenu();
|
||||
var _this = this;
|
||||
this._hideMenu();
|
||||
this.model.unlockFile({
|
||||
@@ -595,6 +606,7 @@ define([
|
||||
},
|
||||
|
||||
viewDetails: function() {
|
||||
this.hideMobileMenu();
|
||||
if (this.dirView.fileCommentsView.$el.is(':visible')) {
|
||||
this.dirView.fileCommentsView.hide();
|
||||
}
|
||||
@@ -699,6 +711,7 @@ define([
|
||||
},
|
||||
|
||||
viewFileComments: function() {
|
||||
this.hideMobileMenu();
|
||||
if (this.dirView.direntDetailsView.$el.is(':visible')) {
|
||||
this.dirView.direntDetailsView.hide();
|
||||
}
|
||||
@@ -717,8 +730,29 @@ define([
|
||||
},
|
||||
|
||||
open_via_client: function() {
|
||||
this.hideMobileMenu();
|
||||
this._hideMenu();
|
||||
return true;
|
||||
},
|
||||
|
||||
showMobileMenu : function(event) {
|
||||
var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null;
|
||||
if(mobileMenu){
|
||||
mobileMenu.slideDown('fast');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
hideMobileMenu: function() {
|
||||
var mobileMenu = this.mobileMenu.length ? this.mobileMenu : null;
|
||||
if(mobileMenu){
|
||||
mobileMenu.slideUp('fast');
|
||||
}
|
||||
},
|
||||
|
||||
closeMobileMenu: function(){
|
||||
this.hideMobileMenu();
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user