mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: optimizes sk body position in RTL mode (#10997)
This commit is contained in:
parent
85f827ee1c
commit
281bf0b345
@ -32,6 +32,12 @@ const SELECT_KIT_OPTIONS = Mixin.create({
|
|||||||
selectKitOptions: EMPTY_OBJECT,
|
selectKitOptions: EMPTY_OBJECT,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isDocumentRTL() {
|
||||||
|
return (
|
||||||
|
window.getComputedStyle(document.querySelector("html")).direction === "rtl"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default Component.extend(
|
export default Component.extend(
|
||||||
SELECT_KIT_OPTIONS,
|
SELECT_KIT_OPTIONS,
|
||||||
PluginApiMixin,
|
PluginApiMixin,
|
||||||
@ -268,7 +274,7 @@ export default Component.extend(
|
|||||||
clearOnClick: false,
|
clearOnClick: false,
|
||||||
closeOnChange: true,
|
closeOnChange: true,
|
||||||
limitMatches: null,
|
limitMatches: null,
|
||||||
placement: "bottom-start",
|
placement: isDocumentRTL() ? "bottom-end" : "bottom-start",
|
||||||
placementStrategy: null,
|
placementStrategy: null,
|
||||||
filterComponent: "select-kit/select-kit-filter",
|
filterComponent: "select-kit/select-kit-filter",
|
||||||
selectedNameComponent: "selected-name",
|
selectedNameComponent: "selected-name",
|
||||||
|
@ -8,7 +8,6 @@ export default Component.extend({
|
|||||||
classNameBindings: ["isLoading"],
|
classNameBindings: ["isLoading"],
|
||||||
appendReason: true,
|
appendReason: true,
|
||||||
showFullTitle: true,
|
showFullTitle: true,
|
||||||
placement: "bottom-start",
|
|
||||||
notificationLevel: null,
|
notificationLevel: null,
|
||||||
topic: null,
|
topic: null,
|
||||||
showCaret: true,
|
showCaret: true,
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
options=(hash
|
options=(hash
|
||||||
icon=icon
|
icon=icon
|
||||||
showFullTitle=showFullTitle
|
showFullTitle=showFullTitle
|
||||||
placement=placement
|
|
||||||
preventsClickPropagation=true
|
preventsClickPropagation=true
|
||||||
showCaret=showCaret
|
showCaret=showCaret
|
||||||
)
|
)
|
||||||
@ -22,7 +21,6 @@
|
|||||||
options=(hash
|
options=(hash
|
||||||
icon=icon
|
icon=icon
|
||||||
showFullTitle=showFullTitle
|
showFullTitle=showFullTitle
|
||||||
placement=placement
|
|
||||||
preventsClickPropagation=true
|
preventsClickPropagation=true
|
||||||
showCaret=showCaret
|
showCaret=showCaret
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user