1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-28 23:07:13 -04:00

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,44 +1,34 @@
'use strict';
var AppLayout = require('../../AppLayout');
var Marionette = require('marionette');
var ProfileView = require('./ProfileView');
var EditProfileView = require('./Edit/EditProfileLayout');
var ProfileCollection = require('./ProfileSchemaCollection');
var _ = require('underscore');
define(['AppLayout',
'marionette',
'Settings/Profile/ProfileView',
'Settings/Profile/Edit/EditProfileLayout',
'Settings/Profile/ProfileSchemaCollection',
'underscore'
], function (AppLayout, Marionette, ProfileView, EditProfileView, ProfileCollection, _) {
return Marionette.CompositeView.extend({
itemView : ProfileView,
itemViewContainer: '.profiles',
template : 'Settings/Profile/ProfileCollectionTemplate',
ui: {
'addCard': '.x-add-card'
},
events: {
'click .x-add-card': '_addProfile'
},
appendHtml: function(collectionView, itemView, index){
collectionView.ui.addCard.parent('li').before(itemView.el);
},
_addProfile: function () {
var self = this;
var schemaCollection = new ProfileCollection();
schemaCollection.fetch({
success: function (collection) {
var model = _.first(collection.models);
model.set('id', undefined);
model.set('name', '');
model.collection = self.collection;
var view = new EditProfileView({ model: model, profileCollection: self.collection});
AppLayout.modalRegion.show(view);
}
});
}
});
});
module.exports = Marionette.CompositeView.extend({
itemView : ProfileView,
itemViewContainer : '.profiles',
template : 'Settings/Profile/ProfileCollectionTemplate',
ui : {"addCard" : '.x-add-card'},
events : {"click .x-add-card" : '_addProfile'},
appendHtml : function(collectionView, itemView, index){
collectionView.ui.addCard.parent('li').before(itemView.el);
},
_addProfile : function(){
var self = this;
var schemaCollection = new ProfileCollection();
schemaCollection.fetch({
success : function(collection){
var model = _.first(collection.models);
model.set('id', undefined);
model.set('name', '');
model.collection = self.collection;
var view = new EditProfileView({
model : model,
profileCollection : self.collection
});
AppLayout.modalRegion.show(view);
}
});
}
});