mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
DEV: adds a caret option to widget dropdown (#9588)
This commit is contained in:
@ -80,6 +80,9 @@ export const WidgetDropdownHeaderClass = {
|
|||||||
<span class="label">
|
<span class="label">
|
||||||
{{transformed.label}}
|
{{transformed.label}}
|
||||||
</span>
|
</span>
|
||||||
|
{{#if attrs.caret}}
|
||||||
|
{{d-icon "caret-down"}}
|
||||||
|
{{/if}}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -218,6 +221,7 @@ export const WidgetDropdownClass = {
|
|||||||
label=attrs.label
|
label=attrs.label
|
||||||
translatedLabel=attrs.translatedLabel
|
translatedLabel=attrs.translatedLabel
|
||||||
class=this.transformed.options.headerClass
|
class=this.transformed.options.headerClass
|
||||||
|
caret=this.transformed.options.caret
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -302,3 +302,18 @@ widgetTest("bodyClass option", {
|
|||||||
assert.ok(body().classList.contains("and-yet-small"));
|
assert.ok(body().classList.contains("and-yet-small"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
widgetTest("caret option", {
|
||||||
|
template: TEMPLATE,
|
||||||
|
|
||||||
|
beforeEach() {
|
||||||
|
this.setProperties(DEFAULT_CONTENT);
|
||||||
|
this.set("options", { caret: true });
|
||||||
|
},
|
||||||
|
|
||||||
|
test(assert) {
|
||||||
|
assert.ok(
|
||||||
|
exists("#my-dropdown .widget-dropdown-header .d-icon-caret-down")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user