mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: enhance problem_list
This commit is contained in:
1 parent
8dabcc3941
commit
43a1730c5c
8 files changed
+198
-36
No files matched your search
@@ -14,7 +14,9 @@ const starPage = new AutoloadPage('starPage', () => {
|
||||
const $button = $(ev.currentTarget);
|
||||
const currentState = $button.hasClass('activated');
|
||||
const $form = $button.closest('form');
|
||||
$form.find('[name="operation"]').val(currentState ? 'unstar' : 'star');
|
||||
const $op = $form.find('[name="operation"]');
|
||||
if (!['star', 'unstar'].includes($op.val())) return;
|
||||
$op.val(currentState ? 'unstar' : 'star');
|
||||
setStarButtonState($button, !currentState);
|
||||
request
|
||||
.post($form.attr('action'), $form)
|
||||
@@ -25,7 +27,6 @@ const starPage = new AutoloadPage('starPage', () => {
|
||||
// TODO: notify failure
|
||||
setStarButtonState($button, currentState);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user