From 213f9057674755fb6b6550ec33bfa502aab310ca Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 13 May 2015 08:45:40 -0700 Subject: [PATCH] Only make manual import cells clickable when previous steps have been done --- src/UI/ManualImport/Cells/EpisodesCell.js | 2 +- src/UI/ManualImport/Cells/SeasonCell.js | 2 +- src/UI/ManualImport/ManualImportRow.js | 7 +++++++ src/UI/ManualImport/manualimport.less | 12 ++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/UI/ManualImport/Cells/EpisodesCell.js b/src/UI/ManualImport/Cells/EpisodesCell.js index b06428394..68c4b5166 100644 --- a/src/UI/ManualImport/Cells/EpisodesCell.js +++ b/src/UI/ManualImport/Cells/EpisodesCell.js @@ -4,7 +4,7 @@ var NzbDroneCell = require('../../Cells/NzbDroneCell'); var SelectEpisodeLayout = require('../Episode/SelectEpisodeLayout'); module.exports = NzbDroneCell.extend({ - className : 'episodes-cell editable', + className : 'episodes-cell', events : { 'click' : '_onClick' diff --git a/src/UI/ManualImport/Cells/SeasonCell.js b/src/UI/ManualImport/Cells/SeasonCell.js index 80f71df5e..6120055ea 100644 --- a/src/UI/ManualImport/Cells/SeasonCell.js +++ b/src/UI/ManualImport/Cells/SeasonCell.js @@ -3,7 +3,7 @@ var NzbDroneCell = require('../../Cells/NzbDroneCell'); var SelectSeasonLayout = require('../Season/SelectSeasonLayout'); module.exports = NzbDroneCell.extend({ - className : 'season-cell editable', + className : 'season-cell', events : { 'click' : '_onClick' diff --git a/src/UI/ManualImport/ManualImportRow.js b/src/UI/ManualImport/ManualImportRow.js index 1974df7bd..5699e83c3 100644 --- a/src/UI/ManualImport/ManualImportRow.js +++ b/src/UI/ManualImport/ManualImportRow.js @@ -10,11 +10,13 @@ module.exports = Backgrid.Row.extend({ this._originalInit.apply(this, arguments); this.listenTo(this.model, 'change', this._setError); + this.listenTo(this.model, 'change', this._setClasses); }, render : function () { this._originalRender.apply(this, arguments); this._setError(); + this._setClasses(); return this; }, @@ -30,5 +32,10 @@ module.exports = Backgrid.Row.extend({ else { this.$el.addClass('manual-import-error'); } + }, + + _setClasses : function () { + this.$el.toggleClass('has-series', this.model.has('series')); + this.$el.toggleClass('has-season', this.model.has('seasonNumber')); } }); \ No newline at end of file diff --git a/src/UI/ManualImport/manualimport.less b/src/UI/ManualImport/manualimport.less index 0d0b1b050..efbc4c933 100644 --- a/src/UI/ManualImport/manualimport.less +++ b/src/UI/ManualImport/manualimport.less @@ -11,6 +11,18 @@ min-width : 80px; } + .has-series { + .season-cell { + .clickable(); + } + } + + .has-season { + .episodes-cell { + .clickable(); + } + } + .editable { .clickable();