diff --git a/app/assets/javascripts/discourse/app/components/reviewable-bundled-action.js b/app/assets/javascripts/discourse/app/components/reviewable-bundled-action.js index 5046c027f24..27b3942f433 100644 --- a/app/assets/javascripts/discourse/app/components/reviewable-bundled-action.js +++ b/app/assets/javascripts/discourse/app/components/reviewable-bundled-action.js @@ -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)); diff --git a/app/assets/javascripts/discourse/app/templates/components/reviewable-bundled-action.hbs b/app/assets/javascripts/discourse/app/templates/components/reviewable-bundled-action.hbs index 1455e3f4e01..c40ac432c36 100644 --- a/app/assets/javascripts/discourse/app/templates/components/reviewable-bundled-action.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/reviewable-bundled-action.hbs @@ -8,6 +8,7 @@ options=(hash icon=bundle.icon disabled=reviewableUpdating + placement=placement ) }} {{else}}