Quality Profile add card

This commit is contained in:
Mark McDowall 2013-07-26 00:04:25 -07:00
parent d7c70a9c91
commit 4f1b27a523
6 changed files with 54 additions and 38 deletions

View file

@ -10,34 +10,21 @@ define([
itemViewContainer: '.notifications',
template : 'Settings/Notifications/CollectionTemplate',
ui: {
'addCard': '.x-add-card'
},
events: {
'click .x-add': '_openSchemaModal',
'click .x-add-card': '_openSchemaModal'
},
onBeforeItemAdded: function () {
this.ui.addCard.remove();
},
onAfterItemAdded: function () {
this._appendAddCard();
},
_openSchemaModal: function () {
SchemaModal.open(this.collection);
},
_appendAddCard: function () {
this.$itemViewContainer.find('.x-add-card').remove();
this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
var html = this.templateFunction();
this.$itemViewContainer.append(html);
},
_openSchemaModal: function () {
SchemaModal.open(this.collection);
}
});
});