mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui-default: init
将ui-default合并至主存储库便于维护
This commit is contained in:
1 parent
6317c9057f
commit
5faa54c7ca
564 files changed
+23083
-14
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import { slideDown, slideUp } from 'vj/utils/slide';
|
||||
|
||||
async function handleSectionExpand(ev) {
|
||||
const $section = $(ev.currentTarget).closest('.training__section');
|
||||
if ($section.is('.expanded, .animating')) {
|
||||
return;
|
||||
}
|
||||
$section.addClass('animating');
|
||||
const $detail = $section.find('.training__section__detail');
|
||||
await slideDown($detail, 300, { opacity: 0 }, { opacity: 1 });
|
||||
$section.addClass('expanded');
|
||||
$section.removeClass('collapsed');
|
||||
$section.removeClass('animating');
|
||||
}
|
||||
|
||||
async function handleSectionCollapse(ev) {
|
||||
const $section = $(ev.currentTarget).closest('.training__section');
|
||||
if ($section.is('.collapsed, .animating')) {
|
||||
return;
|
||||
}
|
||||
$section.addClass('animating');
|
||||
const $detail = $section.find('.training__section__detail');
|
||||
await slideUp($detail, 300, { opacity: 1 }, { opacity: 0 });
|
||||
$section.addClass('collapsed');
|
||||
$section.removeClass('expanded');
|
||||
$section.removeClass('animating');
|
||||
}
|
||||
|
||||
const page = new NamedPage('training_detail', async () => {
|
||||
$(document).on('click', '[name="training__section__expand"]', handleSectionExpand);
|
||||
$(document).on('click', '[name="training__section__collapse"]', handleSectionCollapse);
|
||||
});
|
||||
|
||||
export default page;
|
||||
Reference in new issue
Block a user