Skip to content

Fix some animation bugs #27287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix incorrect this
  • Loading branch information
wxiaoguang committed Sep 26, 2023
commit 7f03e445e81eb219b5ada2a57af440813c1f2b38
8 changes: 4 additions & 4 deletions web_src/js/modules/fomantic.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ export function initGiteaFomantic() {
if (!isAnimationIn && !isAnimationOut) {
toShow = this.hasClass('hidden'); // it is a toggle animation
}
argObj.onStart?.(this);
argObj.onStart?.call(el);
if (toShow) {
el.classList.remove('hidden');
el.classList.add('visible', 'transition');
if (argObj.displayType) el.style.setProperty('display', argObj.displayType, 'important');
argObj.onShow?.(this);
argObj.onShow?.call(el);
} else {
el.classList.add('hidden');
el.classList.remove('visible'); // don't remove the transition class because the Fomantic animation style is `.hidden.transition`.
el.style.removeProperty('display');
argObj.onHidden?.(this);
argObj.onHidden?.call(el);
}
argObj.onComplete?.(this);
argObj.onComplete?.call(el);
});
return this;
};
Expand Down