rjs -> webpack

This commit is contained in:
Keivan Beigi
2015-02-02 17:18:45 -08:00
parent 344f3d66ef
commit 428a1439e5
399 changed files with 11591 additions and 16139 deletions
@@ -1,60 +1,50 @@
'use strict';
var _ = require('underscore');
var $ = require('jquery');
var AppLayout = require('../../../AppLayout');
var Marionette = require('marionette');
var EditView = require('../Edit/NotificationEditView');
define([
'underscore',
'jquery',
'AppLayout',
'marionette',
'Settings/Notifications/Edit/NotificationEditView'
], function (_, $, AppLayout, Marionette, EditView) {
return Marionette.ItemView.extend({
template : 'Settings/Notifications/Add/NotificationAddItemViewTemplate',
tagName : 'li',
className : 'add-thingy-item',
events: {
'click .x-preset': '_addPreset',
'click' : '_add'
},
initialize: function (options) {
this.targetCollection = options.targetCollection;
},
_addPreset: function (e) {
var presetName = $(e.target).closest('.x-preset').attr('data-id');
var presetData = _.where(this.model.get('presets'), {name: presetName})[0];
this.model.set(presetData);
this.model.set({
id : undefined,
onGrab : true,
onDownload : true,
onUpgrade : true
});
var editView = new EditView({ model: this.model, targetCollection: this.targetCollection });
AppLayout.modalRegion.show(editView);
},
_add: function (e) {
if ($(e.target).closest('.btn,.btn-group').length !== 0) {
return;
}
this.model.set({
id : undefined,
onGrab : true,
onDownload : true,
onUpgrade : true
});
var editView = new EditView({ model: this.model, targetCollection: this.targetCollection });
AppLayout.modalRegion.show(editView);
module.exports = Marionette.ItemView.extend({
template : 'Settings/Notifications/Add/NotificationAddItemViewTemplate',
tagName : 'li',
className : 'add-thingy-item',
events : {
"click .x-preset" : '_addPreset',
"click" : '_add'
},
initialize : function(options){
this.targetCollection = options.targetCollection;
},
_addPreset : function(e){
var presetName = $(e.target).closest('.x-preset').attr('data-id');
var presetData = _.where(this.model.get('presets'), {name : presetName})[0];
this.model.set(presetData);
this.model.set({
id : undefined,
onGrab : true,
onDownload : true,
onUpgrade : true
});
var editView = new EditView({
model : this.model,
targetCollection : this.targetCollection
});
AppLayout.modalRegion.show(editView);
},
_add : function(e){
if($(e.target).closest('.btn,.btn-group').length !== 0) {
return;
}
});
});
this.model.set({
id : undefined,
onGrab : true,
onDownload : true,
onUpgrade : true
});
var editView = new EditView({
model : this.model,
targetCollection : this.targetCollection
});
AppLayout.modalRegion.show(editView);
}
});