Check document.dir to determine the position of the icon.

This commit is contained in:
Layal Khatib 2019-12-03 23:09:16 +02:00
parent a6d13e831a
commit 4910dc7973

View file

@ -26,7 +26,7 @@ class Icon {
if (!this.icon) {
return;
}
if (locked) {
this.icon.style.filter = 'saturate(0%)';
} else {
@ -85,7 +85,12 @@ kpxcUI.setIconPosition = function(icon, field) {
const size = Number(icon.getAttribute('size'));
icon.style.top = Pixels((rect.top + document.scrollingElement.scrollTop) + offset + 1);
icon.style.left = Pixels((rect.left + document.scrollingElement.scrollLeft) + field.offsetWidth - size - offset);
if (document.dir == 'rtl') {
icon.style.left = Pixels((rect.left + document.scrollingElement.scrollLeft) + offset);
}
else {
icon.style.left = Pixels((rect.left + document.scrollingElement.scrollLeft) + field.offsetWidth - size - offset);
}
};
/**