Commit b4e0ace7 by Torkel Ödegaard Committed by GitHub

fix: folder picker did not notify parent that the initial folder had been…

fix: folder picker did not notify parent that the initial folder had been changed, fixes #12543 (#12554)
parent 24f395f9
...@@ -104,10 +104,7 @@ export class FolderPickerCtrl { ...@@ -104,10 +104,7 @@ export class FolderPickerCtrl {
appEvents.emit('alert-success', ['Folder Created', 'OK']); appEvents.emit('alert-success', ['Folder Created', 'OK']);
this.closeCreateFolder(); this.closeCreateFolder();
this.folder = { this.folder = { text: result.title, value: result.id };
text: result.title,
value: result.id,
};
this.onFolderChange(this.folder); this.onFolderChange(this.folder);
}); });
} }
...@@ -149,17 +146,14 @@ export class FolderPickerCtrl { ...@@ -149,17 +146,14 @@ export class FolderPickerCtrl {
folder = result.length > 0 ? result[0] : resetFolder; folder = result.length > 0 ? result[0] : resetFolder;
} }
} }
this.folder = folder; this.folder = folder;
this.onFolderLoad();
});
}
private onFolderLoad() { // if this is not the same as our initial value notify parent
if (this.onLoad) { if (this.folder.id !== this.initialFolderId) {
this.onLoad({ this.onChange({ $folder: { id: this.folder.value, title: this.folder.text } });
$folder: { id: this.folder.value, title: this.folder.text }, }
}); });
}
} }
} }
...@@ -176,7 +170,6 @@ export function folderPicker() { ...@@ -176,7 +170,6 @@ export function folderPicker() {
labelClass: '@', labelClass: '@',
rootName: '@', rootName: '@',
onChange: '&', onChange: '&',
onLoad: '&',
onCreateFolder: '&', onCreateFolder: '&',
enterFolderCreation: '&', enterFolderCreation: '&',
exitFolderCreation: '&', exitFolderCreation: '&',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment