Skip to content
Closed
Changes from all commits
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
17 changes: 16 additions & 1 deletion web_src/js/modules/fomantic.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function initGiteaFomantic() {

const isIn = arg?.animation?.endsWith(' in');
const isOut = arg?.animation?.endsWith(' out');
const isScale = arg?.animation?.includes('scale');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe startsWith, assuming this is scale in etc.


let ret;
if (arg === 'show' || isIn) {
Expand All @@ -57,8 +58,22 @@ export function initGiteaFomantic() {
arg?.onHidden?.(this);
});
arg?.onComplete?.(this);
} else if (isScale) {
arg?.onStart?.(this);
ret = this.each((_, el) => {
if (el.classList.contains('hidden')) {
el.classList.remove('hidden');
el.classList.add('visible');
arg?.onShow?.(this);
} else if (el.classList.contains('visible')) {
el.classList.remove('visible');
el.classList.add('hidden');
el.style.removeProperty('display');
arg?.onHidden?.(this);
}
});
arg.onComplete?.(this);
}

return ret;
};

Expand Down