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

[my libs, dir view] improvement: enlarge clickable area, and etc.

This commit is contained in:
llj
2016-12-28 17:08:10 +08:00
parent cffc0743d2
commit 90a5552a9d
4 changed files with 33 additions and 5 deletions

View File

@@ -81,6 +81,7 @@ define([
events: {
'click .select': 'select',
'click .file-star': 'starFile',
'click .dirent-name': 'visitDirent',
'click .img-name-link': 'viewImageWithPopup',
// mv by 'drag & drop'
@@ -337,6 +338,13 @@ define([
return false;
},
visitDirent: function() {
if ($(window).width() < 768 &&
!this.model.get('is_img')) { // dir or non image file
location.href = this.$('.dirent-name a').attr('href');
}
},
viewImageWithPopup: function() {
var index = $('.img-name-link', this.dirView.$dirent_list).index(this.$('.img-name-link'));
$.magnificPopup.open(this.dirView.magnificPopupOptions, index);

View File

@@ -24,6 +24,7 @@ define([
transferTemplate: _.template($('#repo-transfer-form-tmpl').html()),
events: {
'click td:lt(2)': 'visitRepo',
'click .repo-delete-btn': 'del',
'click .repo-share-btn': 'share',
'click .js-repo-rename': 'rename',
@@ -64,6 +65,12 @@ define([
return this;
},
visitRepo: function() {
if ($(window).width() < 768) {
location.href = this.$('.repo-name-span a').attr('href');
}
},
del: function() {
var _this = this;
var repo_name = this.model.get('name');