mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
new design
This commit is contained in:
@@ -12,20 +12,27 @@ define([
|
||||
|
||||
var InvitationsView = Backbone.View.extend({
|
||||
|
||||
id: 'invitations',
|
||||
el: '.main-panel',
|
||||
|
||||
template: _.template($('#invitations-tmpl').html()),
|
||||
toolbarTemplate: _.template($('#invitations-toolbar-tmpl').html()),
|
||||
inviteFormTemplate: _.template($('#invitation-form-tmpl').html()),
|
||||
|
||||
initialize: function() {
|
||||
this.collection = new InvitedPeopleCollection();
|
||||
this.listenTo(this.collection, 'add', this.addOne);
|
||||
this.listenTo(this.collection, 'reset', this.reset);
|
||||
this.render();
|
||||
},
|
||||
|
||||
render: function() {
|
||||
this.$el.html(this.template());
|
||||
renderToolbar: function() {
|
||||
this.$toolbar = $('<div class="cur-view-toolbar" id="invitations-toolbar"></div>').html(this.toolbarTemplate());
|
||||
this.$('.common-toolbar').before(this.$toolbar);
|
||||
},
|
||||
|
||||
renderMainCon: function() {
|
||||
this.$mainCon = $('<div class="main-panel-main" id="invitations"></div>').html(this.template());
|
||||
this.$el.append(this.$mainCon);
|
||||
|
||||
this.$loadingTip = this.$('.loading-tip');
|
||||
this.$table = this.$('table');
|
||||
this.$tableBody = $('tbody', this.$table);
|
||||
@@ -42,7 +49,7 @@ define([
|
||||
var $form = $(this.inviteFormTemplate());
|
||||
var form_id = $form.attr('id');
|
||||
|
||||
$form.modal({appendTo:'#main'});
|
||||
$form.modal();
|
||||
$('#simplemodal-container').css({'height':'auto'});
|
||||
|
||||
$form.submit(function() {
|
||||
@@ -120,10 +127,9 @@ define([
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if (!this.attached) {
|
||||
this.attached = true;
|
||||
$("#right-panel").html(this.$el);
|
||||
}
|
||||
this.renderToolbar();
|
||||
this.renderMainCon();
|
||||
|
||||
this.showContent();
|
||||
},
|
||||
|
||||
@@ -154,8 +160,8 @@ define([
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.$el.detach();
|
||||
this.attached = false;
|
||||
this.$toolbar.detach();
|
||||
this.$mainCon.detach();
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user