Merge pull request #5459 from discourse/fix-rtl-caret-clone-position

FIX: caret clone div position for RTL locales
This commit is contained in:
Simon Cossar 2018-01-22 08:59:31 -08:00 committed by GitHub
commit 2352c5ecd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -54,6 +54,7 @@ $.fn.caretPosition = function(options) {
return styles.getPropertyValue(prop); return styles.getPropertyValue(prop);
}; };
const isRTL = $('html').hasClass('rtl');
clone.css({ clone.css({
border: "1px solid black", border: "1px solid black",
padding: important("padding"), padding: important("padding"),
@ -62,7 +63,8 @@ $.fn.caretPosition = function(options) {
"overflow-y": "auto", "overflow-y": "auto",
"word-wrap": "break-word", "word-wrap": "break-word",
position: "absolute", position: "absolute",
left: "-7000px" left: isRTL ? "auto" : "-7000px",
right: isRTL ? "-7000px" : "auto"
}); });
p.css({ p.css({