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

View File

@@ -1,83 +1,65 @@
'use strict';
define([
'underscore',
'vent',
'AppLayout',
'marionette',
'Settings/Notifications/Delete/NotificationDeleteView',
'Commands/CommandController',
'Mixins/AsModelBoundView',
'Mixins/AsValidatedView',
'Mixins/AsEditModalView',
'Form/FormBuilder',
'Mixins/TagInput'
], function (_, vent, AppLayout, Marionette, DeleteView, CommandController, AsModelBoundView, AsValidatedView, AsEditModalView) {
var _ = require('underscore');
var vent = require('../../../vent');
var AppLayout = require('../../../AppLayout');
var Marionette = require('marionette');
var DeleteView = require('../Delete/NotificationDeleteView');
var CommandController = require('../../../Commands/CommandController');
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
var AsValidatedView = require('../../../Mixins/AsValidatedView');
var AsEditModalView = require('../../../Mixins/AsEditModalView');
require('../../../Form/FormBuilder');
require('../../../Mixins/TagInput');
require('../Add/NotificationSchemaModal');
module.exports = (function(){
var view = Marionette.ItemView.extend({
template: 'Settings/Notifications/Edit/NotificationEditViewTemplate',
ui: {
template : 'Settings/Notifications/Edit/NotificationEditViewTemplate',
ui : {
onDownloadToggle : '.x-on-download',
onUpgradeSection : '.x-on-upgrade',
tags : '.x-tags'
},
events: {
'click .x-back' : '_back',
'change .x-on-download': '_onDownloadChanged'
events : {
"click .x-back" : '_back',
"change .x-on-download" : '_onDownloadChanged'
},
_deleteView: DeleteView,
initialize: function (options) {
_deleteView : DeleteView,
initialize : function(options){
this.targetCollection = options.targetCollection;
},
onRender: function () {
onRender : function(){
this._onDownloadChanged();
this.ui.tags.tagInput({
model : this.model,
property : 'tags'
});
},
_onAfterSave: function () {
this.targetCollection.add(this.model, { merge: true });
_onAfterSave : function(){
this.targetCollection.add(this.model, {merge : true});
vent.trigger(vent.Commands.CloseModalCommand);
},
_onAfterSaveAndAdd: function () {
this.targetCollection.add(this.model, { merge: true });
require('Settings/Notifications/Add/NotificationSchemaModal').open(this.targetCollection);
_onAfterSaveAndAdd : function(){
this.targetCollection.add(this.model, {merge : true});
require('../Add/NotificationSchemaModal').open(this.targetCollection);
},
_back: function () {
if (this.model.isNew()) {
_back : function(){
if(this.model.isNew()) {
this.model.destroy();
}
require('Settings/Notifications/Add/NotificationSchemaModal').open(this.targetCollection);
require('../Add/NotificationSchemaModal').open(this.targetCollection);
},
_onDownloadChanged: function () {
_onDownloadChanged : function(){
var checked = this.ui.onDownloadToggle.prop('checked');
if (checked) {
if(checked) {
this.ui.onUpgradeSection.show();
}
else {
this.ui.onUpgradeSection.hide();
}
}
});
AsModelBoundView.call(view);
AsValidatedView.call(view);
AsEditModalView.call(view);
return view;
});
}).call(this);