Skip to content

Commit 3661eec

Browse files
author
toddw
committed
track for input position changes
1 parent 9277928 commit 3661eec

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

js/jquery.inputHint.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,27 @@
6666
$('body').append(overlay);
6767
},
6868
_removeOverlay = function (element, callback) {
69+
// remove class so _positionUpdateInterval doesn't touch it durring animation
70+
element.removeClass('inputHintOverlay');
6971
element.hide(options['effect'], options['effectOptions'], options['fadeOutSpeed'], function () {
7072
// Now that we have faded out, remove the overlay
7173
element.remove();
7274
});
73-
};
75+
},
76+
_updatePositions = function() {
77+
$(".inputHintOverlay").each(function () {
78+
var offset = $(this).data('inputHintSource').offset();
79+
$(this).css({
80+
'left': offset.left + 'px',
81+
'top': offset.top + 'px'
82+
});
83+
});
84+
},
85+
86+
// Constantly scan for position changes
87+
_positionUpdateInterval = setInterval(function () {
88+
_updatePositions();
89+
}, 500);
7490

7591
// Set the stage and show input hint for all blank inputs with a title
7692
$(this).each(function () {
@@ -94,6 +110,8 @@
94110
_showOverlay($(this));
95111
}
96112
});
113+
114+
// Constantly scan for
97115

98116
return $(this);
99117
};

0 commit comments

Comments
 (0)