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

Restructure views

Conflicts:
	seahub/templates/libraries.html
	static/scripts/app/router.js
	static/scripts/app/views/group.js
	static/scripts/app/views/organization.js
This commit is contained in:
Daniel Pan
2016-03-24 14:43:20 +08:00
parent dd906d7f68
commit 45a7ba13e7
16 changed files with 460 additions and 483 deletions

View File

@@ -10,17 +10,14 @@ define([
var DevicesView = Backbone.View.extend({
el: $('#devices'),
id: 'devices',
template: _.template($('#devices-tmpl').html()),
initialize: function() {
this.$table = this.$('table');
this.$tableBody = this.$('tbody');
this.$loadingTip = this.$('.loading-tip');
this.$emptyTip = this.$('.empty-tips');
this.devices = new DevicesCollection();
this.listenTo(this.devices, 'reset', this.reset);
this.render();
},
addOne: function(device) {
@@ -41,15 +38,23 @@ define([
}
},
hide: function() {
this.$el.hide();
render: function() {
this.$el.html(this.template());
$("#right-panel").html(this.$el);
this.$table = this.$('table');
this.$tableBody = this.$('tbody');
this.$loadingTip = this.$('.loading-tip');
this.$emptyTip = this.$('.empty-tips');
},
show: function() {
this.$el.show();
this.$table.hide();
this.$loadingTip.show();
$("#right-panel").html(this.$el);
this.devices.fetch({reset: true});
},
hide: function() {
this.$el.detach();
}
});