FIX: Adjust reviewable menu placement on mobile (#11420)

Shows the actions dropdown above the triggering button to avoid some
options from displaying below mobile navigation in DiscourseHub.
This commit is contained in:
Penar Musaraj 2020-12-07 13:39:18 -05:00 committed by GitHub
parent 62cf30bec1
commit dd9ec827e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -1,11 +1,21 @@
import { alias, gt } from "@ember/object/computed";
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import { isRTL } from "discourse/lib/text-direction";
export default Component.extend({
tagName: "",
multiple: gt("bundle.actions.length", 1),
first: alias("bundle.actions.firstObject"),
@discourseComputed()
placement() {
const vertical = this.site.mobileView ? "top" : "bottom",
horizontal = isRTL() ? "end" : "start";
return `${vertical}-${horizontal}`;
},
actions: {
performById(id) {
this.attrs.performAction(this.get("bundle.actions").findBy("id", id));

View File

@ -8,6 +8,7 @@
options=(hash
icon=bundle.icon
disabled=reviewableUpdating
placement=placement
)
}}
{{else}}