2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

DEV: allows to set a class on d-popover component (#16670)

This commit is contained in:
Joffrey JAFFEUX 2022-05-06 15:23:35 +02:00 committed by GitHub
parent 7e026e8ddf
commit c99a6b10fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -10,6 +10,8 @@ export default class DiscoursePopover extends Component {
options = null;
class = null;
didInsertElement() {
this._super(...arguments);

View file

@ -1,3 +1,3 @@
<div id={{componentId}} class="d-popover {{if isExpanded "is-expanded"}}">
<div id={{componentId}} class="d-popover {{class}} {{if isExpanded "is-expanded"}}">
{{yield (hash isExpanded=isExpanded)}}
</div>

View file

@ -73,4 +73,12 @@ discourseModule("Integration | Component | d-popover", function (hooks) {
assert.ok(exists(".d-icon-chevron-up"));
},
});
componentTest("d-popover component accepts a class property", {
template: hbs`{{#d-popover class="foo"}}{{/d-popover}}`,
async test(assert) {
assert.ok(exists(".d-popover.foo"));
},
});
});