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"));
},
});
});