mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-25 07:25:12 +00:00
fix MkModal animation
This commit is contained in:
parent
244ea9593a
commit
192add376c
1 changed files with 17 additions and 13 deletions
|
@ -63,6 +63,7 @@ let transformOrigin = $ref('center');
|
|||
let showing = $ref(true);
|
||||
let content = $shallowRef<HTMLElement>();
|
||||
const zIndex = os.claimZIndex(props.zPriority);
|
||||
let useSendAnime = $ref(false);
|
||||
const type = $computed<ModalTypes>(() => {
|
||||
if (props.preferType === 'auto') {
|
||||
if (!defaultStore.state.disableDrawer && isTouchUsing && deviceKind === 'smartphone') {
|
||||
|
@ -76,15 +77,19 @@ const type = $computed<ModalTypes>(() => {
|
|||
});
|
||||
let transitionName = $computed((() =>
|
||||
defaultStore.state.animation
|
||||
? (type === 'drawer')
|
||||
? useSendAnime
|
||||
? 'send'
|
||||
: type === 'drawer'
|
||||
? 'modal-drawer'
|
||||
: (type === 'popup')
|
||||
: type === 'popup'
|
||||
? 'modal-popup'
|
||||
: 'modal'
|
||||
: ''
|
||||
));
|
||||
let transitionDuration = $computed((() =>
|
||||
transitionName === 'modal-popup'
|
||||
transitionName === 'send'
|
||||
? 400
|
||||
: transitionName === 'modal-popup'
|
||||
? 100
|
||||
: transitionName === 'modal'
|
||||
? 200
|
||||
|
@ -97,8 +102,7 @@ let contentClicking = false;
|
|||
|
||||
function close(opts: { useSendAnimation?: boolean } = {}) {
|
||||
if (opts.useSendAnimation) {
|
||||
transitionName = 'send';
|
||||
transitionDuration = 400;
|
||||
useSendAnime = true;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line vue/no-mutating-props
|
||||
|
|
Loading…
Reference in a new issue