mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
utils: module loader register
This commit is contained in:
1 parent
20bbda794e
commit
7dafab8344
50 files changed
+83
-275
No files matched your search
@@ -249,11 +249,7 @@ const page = new NamedPage(['problem_main'], () => {
|
||||
updateSelection();
|
||||
});
|
||||
$('#searchForm').on('submit', updateSelection);
|
||||
let update;
|
||||
$('#searchForm').find('input').on('input', () => {
|
||||
if (update) clearTimeout(update);
|
||||
update = setTimeout(updateSelection, 500);
|
||||
});
|
||||
$('#searchForm').find('input').on('input', _.debounce(updateSelection, 500));
|
||||
$(document).on('click', 'a.pager__item', (ev) => {
|
||||
ev.preventDefault();
|
||||
pjax.request(ev.currentTarget.getAttribute('href')).then(() => window.scrollTo(0, 0));
|
||||
|
||||
@@ -14,11 +14,7 @@ const page = new NamedPage('record_main', async () => {
|
||||
const sock = new WebSocket(UiContext.socketUrl);
|
||||
const dd = new DiffDOM();
|
||||
|
||||
let firstLoad = true;
|
||||
sock.onopen = () => {
|
||||
if (firstLoad) sock.send(JSON.stringify({ rids: UiContext.rids }));
|
||||
firstLoad = false;
|
||||
};
|
||||
sock.onopen = () => sock.send(JSON.stringify({ rids: UiContext.rids }));
|
||||
sock.onmessage = (message) => {
|
||||
const msg = JSON.parse(message.data);
|
||||
const $newTr = $(msg.html);
|
||||
|
||||
Reference in new issue
Block a user