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

Fixes #3036 (supposedly)
pull/3144/head
Ricardo Amaral 6 years ago committed by Leonardo Galli
parent 0783402470
commit 07cb844ce6

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

Loading…
Cancel
Save