2013-05-20 07:19:54 +03:00
|
|
|
'use strict';
|
2013-06-19 04:02:23 +03:00
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'marionette',
|
|
|
|
'Settings/Notifications/ItemView',
|
2013-07-27 02:08:24 +03:00
|
|
|
'Settings/Notifications/SchemaModal'
|
|
|
|
], function (App, Marionette, NotificationItemView, SchemaModal) {
|
2013-06-19 04:02:23 +03:00
|
|
|
return Marionette.CompositeView.extend({
|
|
|
|
itemView : NotificationItemView,
|
2013-06-26 03:34:33 +03:00
|
|
|
itemViewContainer: '.notifications',
|
2013-06-19 04:02:23 +03:00
|
|
|
template : 'Settings/Notifications/CollectionTemplate',
|
2013-05-25 09:38:43 +03:00
|
|
|
|
2013-07-27 01:07:51 +03:00
|
|
|
ui: {
|
|
|
|
'addCard': '.x-add-card'
|
|
|
|
},
|
|
|
|
|
2013-05-25 09:38:43 +03:00
|
|
|
events: {
|
2013-07-26 09:53:37 +03:00
|
|
|
'click .x-add-card': '_openSchemaModal'
|
|
|
|
},
|
|
|
|
|
2013-07-27 01:07:51 +03:00
|
|
|
appendHtml: function(collectionView, itemView, index){
|
|
|
|
collectionView.ui.addCard.parent('li').before(itemView.el);
|
2013-07-26 10:04:25 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
_openSchemaModal: function () {
|
|
|
|
SchemaModal.open(this.collection);
|
2013-05-25 09:38:43 +03:00
|
|
|
}
|
2013-05-20 07:19:54 +03:00
|
|
|
});
|
|
|
|
});
|