1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Changed: Improve model and UI handling for lists. Should finally fix root folder errors. (#3133)

Fixes #3036 (supposedly)
This commit is contained in:
Ricardo Amaral 2018-10-30 10:07:35 +00:00 committed by Leonardo Galli
parent 0783402470
commit 07cb844ce6

View File

@ -44,11 +44,9 @@ var view = Marionette.ItemView.extend({
onRender : function() {
var rootFolder = this.model.get("rootFolderPath");
if (rootFolder !== "") {
//this.ui.rootFolder.val(rootFolder);
this.ui.rootFolder.children().filter(function() {
//may want to use $.trim in here
return $(this).text() === rootFolder;
}).attr('selected', true);
return $.trim($(this).text()) === rootFolder;
}).prop('selected', true);
} else {
var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId);
if (RootFolders.get(defaultRoot)) {
@ -58,7 +56,7 @@ var view = Marionette.ItemView.extend({
},
_onBeforeSave : function() {
var profile = this.ui.profile.val();
var profile = parseInt(this.ui.profile.val(), 10);
var minAvail = this.ui.minimumAvailability.val();
var rootFolderPath = this.ui.rootFolder.children(':selected').text();
this.model.set({