Merge pull request #702 from layalk/ui-rtl-icon-position

Check document.dir to determine the position of the icon.
This commit is contained in:
Sami Vänttinen 2019-12-09 15:30:27 +02:00 committed by GitHub
commit 0bbf03cd1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ class Icon {
if (!this.icon) {
return;
}
if (locked) {
this.icon.style.filter = 'saturate(0%)';
} else {
@ -85,7 +85,11 @@ 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);
}
};
/**