From dff67261142299ab4e6d232fe653579c79f1786e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 8 Feb 2014 11:54:14 -0800 Subject: [PATCH] Enter on add root folder will add folder Renamed Root Folder js files --- src/UI/AddSeries/AddSeriesLayout.js | 4 ++-- ...{Collection.js => RootFolderCollection.js} | 2 +- ...ionView.js => RootFolderCollectionView.js} | 2 +- .../{ItemView.js => RootFolderItemView.js} | 2 +- ...e.html => RootFolderItemViewTemplate.html} | 0 .../{Layout.js => RootFolderLayout.js} | 19 ++++++++++++++----- ...ate.html => RootFolderLayoutTemplate.html} | 0 .../{Model.js => RootFolderModel.js} | 0 src/UI/AddSeries/SearchResultView.js | 4 ++-- .../Series/Editor/SeriesEditorFooterView.js | 4 ++-- 10 files changed, 23 insertions(+), 14 deletions(-) rename src/UI/AddSeries/RootFolders/{Collection.js => RootFolderCollection.js} (89%) rename src/UI/AddSeries/RootFolders/{CollectionView.js => RootFolderCollectionView.js} (85%) rename src/UI/AddSeries/RootFolders/{ItemView.js => RootFolderItemView.js} (91%) rename src/UI/AddSeries/RootFolders/{ItemViewTemplate.html => RootFolderItemViewTemplate.html} (100%) rename src/UI/AddSeries/RootFolders/{Layout.js => RootFolderLayout.js} (79%) rename src/UI/AddSeries/RootFolders/{LayoutTemplate.html => RootFolderLayoutTemplate.html} (100%) rename src/UI/AddSeries/RootFolders/{Model.js => RootFolderModel.js} (100%) diff --git a/src/UI/AddSeries/AddSeriesLayout.js b/src/UI/AddSeries/AddSeriesLayout.js index 1b778546d..e6e265abe 100644 --- a/src/UI/AddSeries/AddSeriesLayout.js +++ b/src/UI/AddSeries/AddSeriesLayout.js @@ -4,11 +4,11 @@ define( 'vent', 'AppLayout', 'marionette', - 'AddSeries/RootFolders/Layout', + 'AddSeries/RootFolders/RootFolderLayout', 'AddSeries/Existing/AddExistingSeriesCollectionView', 'AddSeries/AddSeriesView', 'Quality/QualityProfileCollection', - 'AddSeries/RootFolders/Collection', + 'AddSeries/RootFolders/RootFolderCollection', 'Series/SeriesCollection' ], function (vent, AppLayout, diff --git a/src/UI/AddSeries/RootFolders/Collection.js b/src/UI/AddSeries/RootFolders/RootFolderCollection.js similarity index 89% rename from src/UI/AddSeries/RootFolders/Collection.js rename to src/UI/AddSeries/RootFolders/RootFolderCollection.js index 157bf19ce..364cecea9 100644 --- a/src/UI/AddSeries/RootFolders/Collection.js +++ b/src/UI/AddSeries/RootFolders/RootFolderCollection.js @@ -2,7 +2,7 @@ define( [ 'backbone', - 'AddSeries/RootFolders/Model', + 'AddSeries/RootFolders/RootFolderModel', 'Mixins/backbone.signalr.mixin' ], function (Backbone, RootFolderModel) { diff --git a/src/UI/AddSeries/RootFolders/CollectionView.js b/src/UI/AddSeries/RootFolders/RootFolderCollectionView.js similarity index 85% rename from src/UI/AddSeries/RootFolders/CollectionView.js rename to src/UI/AddSeries/RootFolders/RootFolderCollectionView.js index 689b16132..35ab928d6 100644 --- a/src/UI/AddSeries/RootFolders/CollectionView.js +++ b/src/UI/AddSeries/RootFolders/RootFolderCollectionView.js @@ -3,7 +3,7 @@ define( [ 'marionette', - 'AddSeries/RootFolders/ItemView' + 'AddSeries/RootFolders/RootFolderItemView' ], function (Marionette, RootFolderItemView) { diff --git a/src/UI/AddSeries/RootFolders/ItemView.js b/src/UI/AddSeries/RootFolders/RootFolderItemView.js similarity index 91% rename from src/UI/AddSeries/RootFolders/ItemView.js rename to src/UI/AddSeries/RootFolders/RootFolderItemView.js index 8135d69ab..1fe1e72e7 100644 --- a/src/UI/AddSeries/RootFolders/ItemView.js +++ b/src/UI/AddSeries/RootFolders/RootFolderItemView.js @@ -7,7 +7,7 @@ define( return Marionette.ItemView.extend({ - template: 'AddSeries/RootFolders/ItemViewTemplate', + template: 'AddSeries/RootFolders/RootFolderItemViewTemplate', tagName : 'tr', initialize: function () { diff --git a/src/UI/AddSeries/RootFolders/ItemViewTemplate.html b/src/UI/AddSeries/RootFolders/RootFolderItemViewTemplate.html similarity index 100% rename from src/UI/AddSeries/RootFolders/ItemViewTemplate.html rename to src/UI/AddSeries/RootFolders/RootFolderItemViewTemplate.html diff --git a/src/UI/AddSeries/RootFolders/Layout.js b/src/UI/AddSeries/RootFolders/RootFolderLayout.js similarity index 79% rename from src/UI/AddSeries/RootFolders/Layout.js rename to src/UI/AddSeries/RootFolders/RootFolderLayout.js index 3b54c90a1..7a0886c6f 100644 --- a/src/UI/AddSeries/RootFolders/Layout.js +++ b/src/UI/AddSeries/RootFolders/RootFolderLayout.js @@ -3,16 +3,16 @@ define( [ 'marionette', - 'AddSeries/RootFolders/CollectionView', - 'AddSeries/RootFolders/Collection', - 'AddSeries/RootFolders/Model', + 'AddSeries/RootFolders/RootFolderCollectionView', + 'AddSeries/RootFolders/RootFolderCollection', + 'AddSeries/RootFolders/RootFolderModel', 'Shared/LoadingView', 'Mixins/AsValidatedView', 'Mixins/AutoComplete' ], function (Marionette, RootFolderCollectionView, RootFolderCollection, RootFolderModel, LoadingView, AsValidatedView) { var layout = Marionette.Layout.extend({ - template: 'AddSeries/RootFolders/LayoutTemplate', + template: 'AddSeries/RootFolders/RootFolderLayoutTemplate', ui: { pathInput: '.x-path input' @@ -23,7 +23,8 @@ define( }, events: { - 'click .x-add': '_addFolder' + 'click .x-add': '_addFolder', + 'keydown .x-path input': '_keydown' }, initialize: function () { @@ -65,6 +66,14 @@ define( _showCurrentDirs: function () { this.currentDirs.show(this.rootfolderListView); + }, + + _keydown: function (e) { + if (e.keyCode !== 13) { + return; + } + + this._addFolder(); } }); diff --git a/src/UI/AddSeries/RootFolders/LayoutTemplate.html b/src/UI/AddSeries/RootFolders/RootFolderLayoutTemplate.html similarity index 100% rename from src/UI/AddSeries/RootFolders/LayoutTemplate.html rename to src/UI/AddSeries/RootFolders/RootFolderLayoutTemplate.html diff --git a/src/UI/AddSeries/RootFolders/Model.js b/src/UI/AddSeries/RootFolders/RootFolderModel.js similarity index 100% rename from src/UI/AddSeries/RootFolders/Model.js rename to src/UI/AddSeries/RootFolders/RootFolderModel.js diff --git a/src/UI/AddSeries/SearchResultView.js b/src/UI/AddSeries/SearchResultView.js index eced403ec..c176115ed 100644 --- a/src/UI/AddSeries/SearchResultView.js +++ b/src/UI/AddSeries/SearchResultView.js @@ -6,8 +6,8 @@ define( 'underscore', 'marionette', 'Quality/QualityProfileCollection', - 'AddSeries/RootFolders/Collection', - 'AddSeries/RootFolders/Layout', + 'AddSeries/RootFolders/RootFolderCollection', + 'AddSeries/RootFolders/RootFolderLayout', 'Series/SeriesCollection', 'Config', 'Shared/Messenger', diff --git a/src/UI/Series/Editor/SeriesEditorFooterView.js b/src/UI/Series/Editor/SeriesEditorFooterView.js index 28a27bca4..3d8993ece 100644 --- a/src/UI/Series/Editor/SeriesEditorFooterView.js +++ b/src/UI/Series/Editor/SeriesEditorFooterView.js @@ -7,9 +7,9 @@ define( 'vent', 'Series/SeriesCollection', 'Quality/QualityProfileCollection', - 'AddSeries/RootFolders/Collection', + 'AddSeries/RootFolders/RootFolderCollection', 'Shared/Toolbar/ToolbarLayout', - 'AddSeries/RootFolders/Layout', + 'AddSeries/RootFolders/RootFolderLayout', 'Config' ], function (_, Marionette,