From 5644ca0e0553865a5df6a32c4fd65700e724a6e9 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 6 Jul 2013 14:59:15 -0700 Subject: [PATCH] Fixed folder auto complete --- UI/Settings/DownloadClient/BlackholeView.js | 11 ++++++++++- UI/Settings/DownloadClient/Layout.js | 6 +++++- UI/Settings/DownloadClient/PneumaticView.js | 11 ++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/UI/Settings/DownloadClient/BlackholeView.js b/UI/Settings/DownloadClient/BlackholeView.js index 50d4edc92..c9d91001b 100644 --- a/UI/Settings/DownloadClient/BlackholeView.js +++ b/UI/Settings/DownloadClient/BlackholeView.js @@ -4,11 +4,20 @@ define( [ 'marionette', 'Mixins/AsModelBoundView', + 'Mixins/AutoComplete', 'bootstrap' ], function (Marionette, AsModelBoundView) { var view = Marionette.ItemView.extend({ - template : 'Settings/DownloadClient/BlackholeViewTemplate' + template : 'Settings/DownloadClient/BlackholeViewTemplate', + + ui: { + 'blackholeFolder': '.x-path' + }, + + onShow: function () { + this.ui.blackholeFolder.autoComplete('/directories'); + } }); return AsModelBoundView.call(view); diff --git a/UI/Settings/DownloadClient/Layout.js b/UI/Settings/DownloadClient/Layout.js index 31c59be8e..730ec1cd7 100644 --- a/UI/Settings/DownloadClient/Layout.js +++ b/UI/Settings/DownloadClient/Layout.js @@ -8,6 +8,7 @@ define( 'Settings/DownloadClient/PneumaticView', 'Settings/DownloadClient/NzbgetView', 'Mixins/AsModelBoundView', + 'Mixins/AutoComplete', 'bootstrap' ], function (Marionette, SabView, BlackholeView, PneumaticView, NzbgetView, AsModelBoundView) { @@ -19,7 +20,8 @@ define( }, ui: { - downloadClientSelect: '.x-download-client' + downloadClientSelect: '.x-download-client', + downloadedEpisodesFolder: '.x-path' }, events: { @@ -32,6 +34,8 @@ define( this.pneumaticView = new PneumaticView({ model: this.model}); this.nzbgetView = new NzbgetView({ model: this.model}); + this.ui.downloadedEpisodesFolder.autoComplete('/directories'); + var client = this.model.get('downloadClient'); this.refreshUIVisibility(client); }, diff --git a/UI/Settings/DownloadClient/PneumaticView.js b/UI/Settings/DownloadClient/PneumaticView.js index aa5f29878..524c19eae 100644 --- a/UI/Settings/DownloadClient/PneumaticView.js +++ b/UI/Settings/DownloadClient/PneumaticView.js @@ -4,11 +4,20 @@ define( [ 'marionette', 'Mixins/AsModelBoundView', + 'Mixins/AutoComplete', 'bootstrap' ], function (Marionette, AsModelBoundView) { var view = Marionette.ItemView.extend({ - template : 'Settings/DownloadClient/PneumaticViewTemplate' + template : 'Settings/DownloadClient/PneumaticViewTemplate', + + ui: { + 'pneumaticFolder': '.x-path' + }, + + onShow: function () { + this.ui.pneumaticFolder.autoComplete('/directories'); + } }); return AsModelBoundView.call(view);