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
41e9aa6f
Commit
41e9aa6f
authored
1 year ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix(frontend): センシティブ設定された画像を開くとき一瞬レイアウトが崩れる問題を修正
Fix #10801
parent
1a964257
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/MkMediaList.vue
+2
-58
2 additions, 58 deletions
packages/frontend/src/components/MkMediaList.vue
packages/frontend/src/pages/settings/general.vue
+2
-1
2 additions, 1 deletion
packages/frontend/src/pages/settings/general.vue
with
4 additions
and
59 deletions
packages/frontend/src/components/MkMediaList.vue
+
2
−
58
View file @
41e9aa6f
...
...
@@ -7,7 +7,6 @@
:class=
"[
$style.medias,
count
<
=
4
?
$
style
['
n
'
+
count
]
:
$
style.nMany
,
$
style
[`
n1
$
{defaultStore.reactiveState.mediaListWithOneImageAppearance.value}`]
]"
>
<template
v-for=
"media in mediaList.filter(media => previewable(media))"
>
...
...
@@ -44,37 +43,6 @@ const pswpZIndex = os.claimZIndex('middle');
document
.
documentElement
.
style
.
setProperty
(
'
--mk-pswp-root-z-index
'
,
pswpZIndex
.
toString
());
const
count
=
$computed
(()
=>
props
.
mediaList
.
filter
(
media
=>
previewable
(
media
)).
length
);
function
calcAspectRatio
()
{
if
(
!
gallery
.
value
)
return
;
let
img
=
props
.
mediaList
[
0
];
if
(
props
.
mediaList
.
length
!==
1
||
!
(
img
.
properties
.
width
&&
img
.
properties
.
height
))
{
gallery
.
value
.
style
.
aspectRatio
=
''
;
return
;
}
// アスペクト比上限設定では、横長の場合は高さを縮小させる
const
ratioMax
=
(
ratio
:
number
)
=>
`
${
Math
.
max
(
ratio
,
img
.
properties
.
width
/
img
.
properties
.
height
).
toString
()}
/ 1`
;
switch
(
defaultStore
.
state
.
mediaListWithOneImageAppearance
)
{
case
'
16_9
'
:
gallery
.
value
.
style
.
aspectRatio
=
ratioMax
(
16
/
9
);
break
;
case
'
1_1
'
:
gallery
.
value
.
style
.
aspectRatio
=
ratioMax
(
1
);
break
;
case
'
2_3
'
:
gallery
.
value
.
style
.
aspectRatio
=
ratioMax
(
2
/
3
);
break
;
default
:
gallery
.
value
.
style
.
aspectRatio
=
''
;
break
;
}
}
watch
([
defaultStore
.
reactiveState
.
mediaListWithOneImageAppearance
,
gallery
],
()
=>
calcAspectRatio
());
onMounted
(()
=>
{
const
lightbox
=
new
PhotoSwipeLightbox
({
dataSource
:
props
.
mediaList
...
...
@@ -194,36 +162,12 @@ const previewable = (file: misskey.entities.DriveFile): boolean => {
display
:
grid
;
grid-gap
:
8px
;
// for webkit
height
:
100%
;
&
.n1
{
aspect-ratio
:
16
/
9
;
grid-template-rows
:
1fr
;
// default (expand)
min-height
:
64px
;
max-height
:
clamp
(
64px
,
calc
(
var
(
--
containerHeight
,
100svh
)
*
0
.5
)
,
//
but
--
containerHeight
can
broken
(
too
big
)
min
(
334px
,
50vh
)
);
&
.n116_9
{
min-height
:
none
;
max-height
:
none
;
aspect-ratio
:
16
/
9
;
// fallback
}
&
.n11_1
{
min-height
:
none
;
max-height
:
none
;
aspect-ratio
:
1
/
1
;
// fallback
}
&
.n12_3
{
min-height
:
none
;
max-height
:
none
;
aspect-ratio
:
2
/
3
;
// fallback
}
}
&
.n2
{
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/pages/settings/general.vue
+
2
−
1
View file @
41e9aa6f
...
...
@@ -56,7 +56,7 @@
<option
value=
"ignore"
>
{{ i18n.ts._nsfw.ignore }}
</option>
<option
value=
"force"
>
{{ i18n.ts._nsfw.force }}
</option>
</MkSelect>
<!--
<MkRadios v-model="mediaListWithOneImageAppearance">
<template #label>{{ i18n.ts.mediaListWithOneImageAppearance }}</template>
<option value="expand">{{ i18n.ts.default }}</option>
...
...
@@ -64,6 +64,7 @@
<option value="1_1">{{ i18n.t('limitTo', { x: '1:1' }) }}</option>
<option value="2_3">{{ i18n.t('limitTo', { x: '2:3' }) }}</option>
</MkRadios>
-->
</div>
</FormSection>
...
...
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