mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 08:15:00 +00:00
DEV: allows categories-admin-dropdown to have custom items (#9931)
Usage: ``` modifySelectKit("categories-admin-dropdown").appendContent(function() { return { id: "foo", name: I18n.t("foo"), description: I18n.t("foo_description"), icon: "gear", onChange: () => alert("Foo.") }; }); ```
This commit is contained in:
parent
2b2434b82d
commit
931bfca454
@ -36,5 +36,13 @@ export default DropdownSelectBoxComponent.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
})
|
}),
|
||||||
|
|
||||||
|
_onChange(value, item) {
|
||||||
|
if (item.onChange) {
|
||||||
|
item.onChange(value, item);
|
||||||
|
} else if (this.attrs.onChange) {
|
||||||
|
this.attrs.onChange(value, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user