FIX: handles boolean with popupMenuOption (#7299)
Handle the case of https://github.com/discourse/DiscoTOC doing this kind of setup: ``` return { action: "insertDtoc", icon: "align-left", label: themePrefix("insert_table_of_contents"), condition: !composerController.get("model.canCategorize") }; ``` In this case there's no function to call, it's already set.
This commit is contained in:
parent
a6596662dc
commit
4b1b135ede
|
@ -255,10 +255,12 @@ export default Ember.Controller.extend({
|
|||
_setupPopupMenuOption(callback) {
|
||||
let option = callback();
|
||||
|
||||
if (option.condition) {
|
||||
option.condition = this.get(option.condition);
|
||||
} else {
|
||||
if (typeof option.condition === "undefined") {
|
||||
option.condition = true;
|
||||
} else if (typeof option.condition === "boolean") {
|
||||
// uses existing value
|
||||
} else {
|
||||
option.condition = this.get(option.condition);
|
||||
}
|
||||
|
||||
return option;
|
||||
|
|
Loading…
Reference in New Issue