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