2013-06-22 09:24:24 +03:00
|
|
|
'use strict';
|
2013-06-19 04:02:23 +03:00
|
|
|
|
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'marionette',
|
|
|
|
'Settings/Notifications/EditView'
|
|
|
|
], function (App, Marionette, EditView) {
|
|
|
|
|
|
|
|
return Marionette.ItemView.extend({
|
|
|
|
template: 'Settings/Notifications/AddItemTemplate',
|
|
|
|
tagName : 'li',
|
|
|
|
|
|
|
|
events: {
|
|
|
|
'click': 'addNotification'
|
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function (options) {
|
|
|
|
this.notificationCollection = options.notificationCollection;
|
|
|
|
},
|
|
|
|
|
2013-07-27 23:57:41 +03:00
|
|
|
addNotification: function (e) {
|
|
|
|
if ($(e.target).hasClass('icon-info-sign')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-07-29 04:42:47 +03:00
|
|
|
this.model.set({
|
|
|
|
id: undefined,
|
2013-08-01 18:25:09 +03:00
|
|
|
name: this.model.get('implementationName'),
|
|
|
|
onGrab: true,
|
|
|
|
onDownload: true
|
2013-07-29 04:42:47 +03:00
|
|
|
});
|
|
|
|
|
2013-06-19 04:02:23 +03:00
|
|
|
var editView = new EditView({ model: this.model, notificationCollection: this.notificationCollection });
|
|
|
|
App.modalRegion.show(editView);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|