Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
8bc0aa3e
Commit
8bc0aa3e
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
🎨
parent
a4a614e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/frontend/src/components/MkModal.vue
+9
-9
9 additions, 9 deletions
packages/frontend/src/components/MkModal.vue
packages/frontend/src/scripts/touch.ts
+4
-14
4 additions, 14 deletions
packages/frontend/src/scripts/touch.ts
with
13 additions
and
23 deletions
packages/frontend/src/components/MkModal.vue
+
9
−
9
View file @
8bc0aa3e
...
...
@@ -63,17 +63,17 @@ let transformOrigin = $ref('center');
let
showing
=
$ref
(
true
);
let
content
=
$ref
<
HTMLElement
>
();
const
zIndex
=
os
.
claimZIndex
(
props
.
zPriority
);
const
type
=
$computed
(()
=>
{
if
(
props
.
preferType
===
'
auto
'
)
{
if
(
!
defaultStore
.
state
.
disableDrawer
&&
isTouchUsing
&&
deviceKind
===
'
smartphone
'
)
{
return
'
drawer
'
;
}
else
{
return
props
.
src
!=
null
?
'
popup
'
:
'
dialog
'
;
}
let
type
=
$ref
<
ModalTypes
>
();
console
.
log
(
props
.
preferType
,
isTouchUsing
,
deviceKind
);
if
(
props
.
preferType
===
'
auto
'
)
{
if
(
!
defaultStore
.
state
.
disableDrawer
&&
isTouchUsing
&&
deviceKind
===
'
smartphone
'
)
{
type
=
'
drawer
'
;
}
else
{
return
props
.
preferType
!
;
type
=
props
.
src
!=
null
?
'
popup
'
:
'
dialog
'
;
}
});
}
else
{
type
=
props
.
preferType
!
;
}
let
transitionName
=
$ref
(
defaultStore
.
state
.
animation
?
(
type
===
'
drawer
'
)
?
'
modal-drawer
'
:
(
type
===
'
popup
'
)
?
'
modal-popup
'
:
'
modal
'
:
''
);
let
transitionDuration
=
$ref
(
defaultStore
.
state
.
animation
?
200
:
0
);
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/scripts/touch.ts
+
4
−
14
View file @
8bc0aa3e
const
isTouchSupported
=
'
maxTouchPoints
'
in
navigator
&&
navigator
.
maxTouchPoints
>
0
;
import
{
deviceKind
}
from
'
@/scripts/device-kind
'
;
export
let
isTouchUsing
=
false
;
const
isTouchSupported
=
'
maxTouchPoints
'
in
navigator
&&
navigator
.
maxTouchPoints
>
0
;
export
let
is
Screen
Touching
=
false
;
export
let
isTouch
Us
ing
=
deviceKind
===
'
tablet
'
||
deviceKind
===
'
smartphone
'
;
if
(
isTouchSupported
)
{
if
(
isTouchSupported
&&
!
isTouchUsing
)
{
window
.
addEventListener
(
'
touchstart
'
,
()
=>
{
// maxTouchPointsなどでの判定だけだと、「タッチ機能付きディスプレイを使っているがマウスでしか操作しない」場合にも
// タッチで使っていると判定されてしまうため、実際に一度でもタッチされたらtrueにする
isTouchUsing
=
true
;
isScreenTouching
=
true
;
},
{
passive
:
true
});
window
.
addEventListener
(
'
touchend
'
,
()
=>
{
// 子要素のtouchstartイベントでstopPropagation()が呼ばれると親要素に伝搬されずタッチされたと判定されないため、
// touchendイベントでもtouchstartイベントと同様にtrueにする
isTouchUsing
=
true
;
isScreenTouching
=
false
;
},
{
passive
:
true
});
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment