FIX: hides dropdown if no actions available

This commit is contained in:
jjaffeux 2020-05-04 10:55:37 +02:00
parent 11ba398069
commit 31a8524a80
2 changed files with 12 additions and 0 deletions

View File

@ -28,6 +28,13 @@ export default createWidget("more-dropdown", {
}} }}
`, `,
buildClasses(attrs) {
const content = this._buildContent(attrs);
if (!content.length) {
return ["has-no-actions"];
}
},
_buildContent(attrs) { _buildContent(attrs) {
const content = []; const content = [];
@ -76,6 +83,7 @@ export default createWidget("more-dropdown", {
param: attrs.postEventId param: attrs.postEventId
}); });
} }
return content; return content;
} }
}); });

View File

@ -48,6 +48,10 @@
align-self: flex-start; align-self: flex-start;
margin-top: 1em; margin-top: 1em;
&.has-no-actions {
display: none;
}
.widget-dropdown { .widget-dropdown {
.widget-dropdown-header { .widget-dropdown-header {
.d-icon { .d-icon {