mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
FEATURE: color-palettes component (#6992)
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
import ComboBoxComponent from "select-kit/components/combo-box";
|
||||
|
||||
export default ComboBoxComponent.extend({
|
||||
pluginApiIdentifiers: ["color-palettes"],
|
||||
classNames: "color-palettes",
|
||||
rowComponent: "color-palettes/color-palettes-row"
|
||||
});
|
@ -0,0 +1,14 @@
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default SelectKitRowComponent.extend({
|
||||
layoutName:
|
||||
"select-kit/templates/components/color-palettes/color-palettes-row",
|
||||
classNames: "color-palettes-row",
|
||||
|
||||
@computed("computedContent.originalContent.colors")
|
||||
colors(colors) {
|
||||
return (colors || []).map(color => `#${escapeExpression(color.hex)}`);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user