From dd6dc38672fb09a743b994f54b5f926fa94f054d Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 6 Mar 2015 22:37:31 -0800 Subject: [PATCH] Series editor cleanup --- src/UI/Cells/ProfileCell.js | 8 +++++ .../Series/Editor/SeriesEditorFooterView.js | 21 +++---------- .../Editor/SeriesEditorFooterViewTemplate.hbs | 30 +++++++++---------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/src/UI/Cells/ProfileCell.js b/src/UI/Cells/ProfileCell.js index 11da11ee7..d87ee1af9 100644 --- a/src/UI/Cells/ProfileCell.js +++ b/src/UI/Cells/ProfileCell.js @@ -5,6 +5,14 @@ var _ = require('underscore'); module.exports = Backgrid.Cell.extend({ className : 'profile-cell', + _originalInit : Backgrid.Cell.prototype.initialize, + + initialize : function () { + this._originalInit.apply(this, arguments); + + this.listenTo(ProfileCollection, 'sync', this.render); + }, + render : function() { this.$el.empty(); diff --git a/src/UI/Series/Editor/SeriesEditorFooterView.js b/src/UI/Series/Editor/SeriesEditorFooterView.js index be1e0d682..6f4f83a6c 100644 --- a/src/UI/Series/Editor/SeriesEditorFooterView.js +++ b/src/UI/Series/Editor/SeriesEditorFooterView.js @@ -1,10 +1,8 @@ var _ = require('underscore'); var Marionette = require('marionette'); -var Backgrid = require('backgrid'); var vent = require('vent'); var Profiles = require('../../Profile/ProfileCollection'); var RootFolders = require('../../AddSeries/RootFolders/RootFolderCollection'); -var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout'); var RootFolderLayout = require('../../AddSeries/RootFolders/RootFolderLayout'); var UpdateFilesSeriesView = require('./Organize/OrganizeFilesView'); var Config = require('../../Config'); @@ -18,9 +16,8 @@ module.exports = Marionette.ItemView.extend({ seasonFolder : '.x-season-folder', rootFolder : '.x-root-folder', selectedCount : '.x-selected-count', - saveButton : '.x-save', - organizeFilesButton : '.x-organize-files', - container : '.series-editor-footer' + container : '.series-editor-footer', + actions : '.x-action' }, events : { @@ -96,19 +93,9 @@ module.exports = Marionette.ItemView.extend({ this.ui.selectedCount.html('{0} series selected'.format(selectedCount)); if (selectedCount === 0) { - this.ui.monitored.attr('disabled', ''); - this.ui.profile.attr('disabled', ''); - this.ui.seasonFolder.attr('disabled', ''); - this.ui.rootFolder.attr('disabled', ''); - this.ui.saveButton.attr('disabled', ''); - this.ui.organizeFilesButton.attr('disabled', ''); + this.ui.actions.attr('disabled', 'disabled'); } else { - this.ui.monitored.removeAttr('disabled', ''); - this.ui.profile.removeAttr('disabled', ''); - this.ui.seasonFolder.removeAttr('disabled', ''); - this.ui.rootFolder.removeAttr('disabled', ''); - this.ui.saveButton.removeAttr('disabled', ''); - this.ui.organizeFilesButton.removeAttr('disabled', ''); + this.ui.actions.removeAttr('disabled'); } }, diff --git a/src/UI/Series/Editor/SeriesEditorFooterViewTemplate.hbs b/src/UI/Series/Editor/SeriesEditorFooterViewTemplate.hbs index 630ec279f..c47b3c50a 100644 --- a/src/UI/Series/Editor/SeriesEditorFooterViewTemplate.hbs +++ b/src/UI/Series/Editor/SeriesEditorFooterViewTemplate.hbs @@ -3,27 +3,17 @@
-
-
- - - -
-
- {{#each profiles.models}} @@ -31,10 +21,20 @@
+
+ + + +
+
- {{#each rootFolders}} @@ -46,8 +46,8 @@
- - + +