mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
parent
62cf30bec1
commit
dd9ec827e5
@ -1,11 +1,21 @@
|
|||||||
import { alias, gt } from "@ember/object/computed";
|
import { alias, gt } from "@ember/object/computed";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
|
import { isRTL } from "discourse/lib/text-direction";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "",
|
tagName: "",
|
||||||
|
|
||||||
multiple: gt("bundle.actions.length", 1),
|
multiple: gt("bundle.actions.length", 1),
|
||||||
first: alias("bundle.actions.firstObject"),
|
first: alias("bundle.actions.firstObject"),
|
||||||
|
|
||||||
|
@discourseComputed()
|
||||||
|
placement() {
|
||||||
|
const vertical = this.site.mobileView ? "top" : "bottom",
|
||||||
|
horizontal = isRTL() ? "end" : "start";
|
||||||
|
return `${vertical}-${horizontal}`;
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
performById(id) {
|
performById(id) {
|
||||||
this.attrs.performAction(this.get("bundle.actions").findBy("id", id));
|
this.attrs.performAction(this.get("bundle.actions").findBy("id", id));
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
options=(hash
|
options=(hash
|
||||||
icon=bundle.icon
|
icon=bundle.icon
|
||||||
disabled=reviewableUpdating
|
disabled=reviewableUpdating
|
||||||
|
placement=placement
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
Loading…
Reference in New Issue
Block a user