mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 23:00:57 +00:00
[mobile] favourites: redesigned it.
This commit is contained in:
@@ -11,6 +11,7 @@ define([
|
||||
tagName: 'tr',
|
||||
|
||||
template: _.template($('#starred-file-item-tmpl').html()),
|
||||
mobileTemplate: _.template($('#starred-file-item-mobile-tmpl').html()),
|
||||
|
||||
events: {
|
||||
'click .unstar': 'removeShare'
|
||||
@@ -26,7 +27,8 @@ define([
|
||||
data['is_img'] = Common.imageCheck(data['file_name']);
|
||||
data['encoded_path'] = Common.encodePath(data['path']);
|
||||
|
||||
this.$el.html(this.template(data));
|
||||
var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate;
|
||||
this.$el.html(tmpl(data));
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@@ -14,6 +14,7 @@ define([
|
||||
id: 'starred-file',
|
||||
|
||||
template: _.template($('#starred-file-tmpl').html()),
|
||||
theadTemplate: _.template($('#starred-file-thead-tmpl').html()),
|
||||
|
||||
initialize: function() {
|
||||
this.starredFiles = new StarredFilesCollection();
|
||||
@@ -29,9 +30,10 @@ define([
|
||||
reset: function() {
|
||||
this.$tableBody.empty();
|
||||
this.$loadingTip.hide();
|
||||
this.starredFiles.each(this.addOne, this);
|
||||
if (this.starredFiles.length) {
|
||||
this.$emptyTip.hide();
|
||||
this.renderThead();
|
||||
this.starredFiles.each(this.addOne, this);
|
||||
this.$table.show();
|
||||
} else {
|
||||
this.$emptyTip.show();
|
||||
@@ -77,6 +79,10 @@ define([
|
||||
});
|
||||
},
|
||||
|
||||
renderThead: function() {
|
||||
this.$('thead').html(this.theadTemplate());
|
||||
},
|
||||
|
||||
show: function() {
|
||||
$("#right-panel").html(this.$el);
|
||||
this.showStarredFiles();
|
||||
|
Reference in New Issue
Block a user