Fixed input field and tipsy positioning in singleselect
If the user scrolls or the window is resized, the formerly cached offset was wrong. This fix makes sure the offset is re-read before showing the input field.
This commit is contained in:
parent
9d230bcc75
commit
28fbc1b3cc
|
@ -7,11 +7,7 @@
|
||||||
input.attr('title', inputTooltip);
|
input.attr('title', inputTooltip);
|
||||||
}
|
}
|
||||||
select = $(select);
|
select = $(select);
|
||||||
if ($.fn.tipsy){
|
|
||||||
input.tipsy({gravity: 'n', trigger: 'manual'});
|
|
||||||
}
|
|
||||||
input.css('position', 'absolute');
|
input.css('position', 'absolute');
|
||||||
input.css(select.offset());
|
|
||||||
input.css({
|
input.css({
|
||||||
'box-sizing': 'border-box',
|
'box-sizing': 'border-box',
|
||||||
'-moz-box-sizing': 'border-box',
|
'-moz-box-sizing': 'border-box',
|
||||||
|
@ -35,8 +31,11 @@
|
||||||
select.data('previous', value);
|
select.data('previous', value);
|
||||||
} else {
|
} else {
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
// adjust offset, in case the user scrolled
|
||||||
|
input.css(select.offset());
|
||||||
input.show();
|
input.show();
|
||||||
if ($.fn.tipsy){
|
if ($.fn.tipsy){
|
||||||
|
input.tipsy({gravity: 'n', trigger: 'manual'});
|
||||||
input.tipsy('show');
|
input.tipsy('show');
|
||||||
}
|
}
|
||||||
select.css('background-color', 'white');
|
select.css('background-color', 'white');
|
||||||
|
|
Loading…
Reference in New Issue