mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix #478
This commit is contained in:
1 parent
f24784504c
commit
d0298607d1
1 file changed
+1
-1
@@ -12,12 +12,12 @@ function setStarButtonState($starButton: JQuery<any>, star: boolean) {
|
||||
|
||||
const starPage = new AutoloadPage('starPage', () => {
|
||||
$(document).on('click', '.star', (ev) => {
|
||||
ev.preventDefault();
|
||||
const $button = $(ev.currentTarget);
|
||||
const currentState = $button.hasClass('activated');
|
||||
const $form = $button.closest('form');
|
||||
const $op = $form.find('[name="operation"]');
|
||||
if (!['star', 'unstar'].includes($op.val() as any)) return;
|
||||
ev.preventDefault();
|
||||
$op.val(currentState ? 'unstar' : 'star');
|
||||
setStarButtonState($button, !currentState);
|
||||
request
|
||||
|
||||
Reference in new issue
Block a user