mirror of https://github.com/zulip/zulip.git
hotspots: Debounce hotspot placement on UI updates by 10ms.
A small delay to ensure that the event (i.e. a click) has completed and the UI has updated before hotspot icon and popover placement is recomputed.
This commit is contained in:
parent
5ce0db9f43
commit
1e40665e51
|
@ -239,10 +239,10 @@ function insert_hotspot_into_DOM(hotspot) {
|
|||
// reposition on any event that might update the UI
|
||||
['resize', 'scroll', 'onkeydown', 'click']
|
||||
.forEach(function (event_name) {
|
||||
window.addEventListener(event_name, function () {
|
||||
window.addEventListener(event_name, _.debounce(function () {
|
||||
place_icon(hotspot);
|
||||
place_popover(hotspot);
|
||||
}, true);
|
||||
}, 10), true);
|
||||
});
|
||||
}, (hotspot.delay * 100));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue