Align hint at right of input if it is exceeding window size

master
Vitaliy Filippov 2014-09-22 13:51:06 +00:00
parent 08bd47dd42
commit 6b89889145
2 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,7 @@
Homepage: http://yourcmc.ru/wiki/SimpleAutocomplete
License: MPL 2.0+ (http://www.mozilla.org/MPL/2.0/)
Version: 2014-09-11
Version: 2014-09-22
(c) Vitaliy Filippov 2011-2014
Usage:
@ -391,6 +391,12 @@ SimpleAutocomplete.prototype.show = function()
this.hintLayer.style.top = (p.top+this.input.offsetHeight) + 'px';
this.hintLayer.style.left = p.left + 'px';
this.hintLayer.style.display = '';
var sw = document.clientWidth || document.documentElement.clientWidth || document.body.clientWidth;
if (p.left + this.hintLayer.offsetWidth > sw)
{
this.hintLayer.style.right = (sw-p.left-this.input.offsetWidth)+'px';
this.hintLayer.style.left = '';
}
return true;
}
};

2
hinter.min.js vendored

File diff suppressed because one or more lines are too long