UI dependency graph cleanup

This commit is contained in:
kayone
2013-10-08 18:43:41 -07:00
parent 86ea33b638
commit 4948d0608b
87 changed files with 1119 additions and 735 deletions
+13 -10
View File
@@ -1,10 +1,13 @@
'use strict';
define(['app',
'marionette',
'Settings/Indexers/ItemView',
'Settings/Indexers/EditView',
'Settings/Indexers/Collection'],
function (App, Marionette, IndexerItemView, IndexerEditView, IndexerCollection) {
define(
[
'AppLayout',
'marionette',
'Settings/Indexers/ItemView',
'Settings/Indexers/EditView',
'Settings/Indexers/Collection',
'underscore'
], function (AppLayout, Marionette, IndexerItemView, IndexerEditView, IndexerCollection, _) {
return Marionette.CompositeView.extend({
itemView : IndexerItemView,
itemViewContainer: '#x-indexers',
@@ -18,7 +21,7 @@ define(['app',
'click .x-add-card': '_openSchemaModal'
},
appendHtml: function(collectionView, itemView, index){
appendHtml: function (collectionView, itemView, index) {
collectionView.ui.addCard.parent('li').before(itemView.el);
},
@@ -33,13 +36,13 @@ define(['app',
var model = _.first(collection.models);
model.set({
id: undefined,
name: '',
id : undefined,
name : '',
enable: true
});
var view = new IndexerEditView({ model: model, indexerCollection: self.collection});
App.modalRegion.show(view);
AppLayout.modalRegion.show(view);
}
});
}
-19
View File
@@ -1,19 +0,0 @@
'use strict';
define(['app', 'marionette'], function (App, Marionette) {
return Marionette.ItemView.extend({
template: 'Settings/Notifications/DeleteTemplate',
events: {
'click .x-confirm-delete': '_removeIndexer'
},
_removeIndexer: function () {
this.model.destroy({
wait : true,
success: function () {
App.vent.trigger(App.Commands.CloseModalCommand);
}
});
}
});
});
+6 -5
View File
@@ -2,16 +2,17 @@
define(
[
'app',
'vent',
'marionette',
'Mixins/AsModelBoundView',
'Mixins/AsValidatedView'
], function (App, Marionette, AsModelBoundView, AsValidatedView) {
'Mixins/AsValidatedView',
'underscore'
], function (vent, Marionette, AsModelBoundView, AsValidatedView, _) {
var view = Marionette.ItemView.extend({
template: 'Settings/Indexers/EditTemplate',
ui : {
ui: {
activity: '.x-activity'
},
@@ -33,7 +34,7 @@ define(
if (promise) {
promise.done(function () {
self.indexerCollection.add(self.model, { merge: true });
App.vent.trigger(App.Commands.CloseModalCommand);
vent.trigger(vent.Commands.CloseModalCommand);
});
promise.fail(function () {
+3 -3
View File
@@ -2,12 +2,12 @@
define(
[
'app',
'AppLayout',
'marionette',
'Settings/Notifications/DeleteView',
'Mixins/AsModelBoundView',
'Mixins/AsValidatedView'
], function (App, Marionette, DeleteView, AsModelBoundView, AsValidatedView) {
], function (AppLayout, Marionette, DeleteView, AsModelBoundView, AsValidatedView) {
var view = Marionette.ItemView.extend({
template: 'Settings/Indexers/ItemTemplate',
@@ -19,7 +19,7 @@ define(
_deleteIndexer: function () {
var view = new DeleteView({ model: this.model});
App.modalRegion.show(view);
AppLayout.modalRegion.show(view);
}
});