Открыть боковую панель
GitLab.org
Gitlab
Коммиты
b0dd7933
Коммит
b0dd7933
создал
Дек 14, 2021
по автору
Tim Zallmann
Просмотр файлов
Execute mouseout only 'once'
владелец
ef3024ea
Изменения
1
Скрыть пробелы
Построчно
Рядом
app/assets/javascripts/lib/utils/navigation_utility.js
Просмотр файла @
b0dd7933
...
...
@@ -34,14 +34,13 @@ export function initPrefetchLinks(selector) {
};
const
mouseOverHandler
=
()
=>
{
el
.
addEventListener
(
'
mouseout
'
,
mouseOutHandler
,
{
passive
:
true
});
el
.
addEventListener
(
'
mouseout
'
,
mouseOutHandler
,
{
once
:
true
,
passive
:
true
});
mouseOverTimer
=
setTimeout
(()
=>
{
if
(
el
.
href
)
prefetchDocument
(
el
.
href
);
// Only execute once
el
.
removeEventListener
(
'
mouseover
'
,
mouseOverHandler
,
true
);
el
.
removeEventListener
(
'
mouseout
'
,
mouseOutHandler
);
mouseOverTimer
=
undefined
;
},
100
);
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать