From 224ef64e6ef88349c4cdbcee6bf3b37342af3a36 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 26 Jul 2013 00:46:24 -0700 Subject: [PATCH] Fixed alignment issues and better rendering for add cards --- UI/Settings/Indexers/CollectionView.js | 4 ++-- UI/Settings/Notifications/CollectionView.js | 4 ++-- UI/Settings/Quality/Profile/QualityProfileCollectionView.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UI/Settings/Indexers/CollectionView.js b/UI/Settings/Indexers/CollectionView.js index e5cf55d52..4d34e4e76 100644 --- a/UI/Settings/Indexers/CollectionView.js +++ b/UI/Settings/Indexers/CollectionView.js @@ -14,8 +14,8 @@ define(['app', 'click .x-add-card': '_openSchemaModal' }, - onAfterItemAdded: function () { - this.$itemViewContainer.find('.x-add-card').parent('li').remove(); + onRender: function () { + this.listenTo(this.collection, 'add', this.render); this.templateFunction = Marionette.TemplateCache.get('Settings/Indexers/AddCardTemplate'); var html = this.templateFunction(); diff --git a/UI/Settings/Notifications/CollectionView.js b/UI/Settings/Notifications/CollectionView.js index 5bdae6b40..bd4d9a546 100644 --- a/UI/Settings/Notifications/CollectionView.js +++ b/UI/Settings/Notifications/CollectionView.js @@ -14,8 +14,8 @@ define([ 'click .x-add-card': '_openSchemaModal' }, - onAfterItemAdded: function () { - this.$itemViewContainer.find('.x-add-card').parent('li').remove(); + onRender: function () { + this.listenTo(this.collection, 'add', this.render); this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate'); var html = this.templateFunction(); diff --git a/UI/Settings/Quality/Profile/QualityProfileCollectionView.js b/UI/Settings/Quality/Profile/QualityProfileCollectionView.js index eee379df1..7cb1e1b6b 100644 --- a/UI/Settings/Quality/Profile/QualityProfileCollectionView.js +++ b/UI/Settings/Quality/Profile/QualityProfileCollectionView.js @@ -16,8 +16,8 @@ define(['app', 'click .x-add-card': '_addProfile' }, - onAfterItemAdded: function () { - this.$itemViewContainer.find('.x-add-card').parent('li').remove(); + onRender: function () { + this.listenTo(this.collection, 'add', this.render); this.templateFunction = Marionette.TemplateCache.get('Settings/Quality/Profile/AddCardTemplate'); var html = this.templateFunction();