Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
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
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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
00240896
Commit
00240896
authored
1 year ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fixes
#3730
Closes
#3730
Merge request
!2615
parent
eded26a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/vue/components/stock-images/UploadBox.vue
+30
-9
30 additions, 9 deletions
resources/vue/components/stock-images/UploadBox.vue
with
30 additions
and
9 deletions
resources/vue/components/stock-images/UploadBox.vue
+
30
−
9
View file @
00240896
<
template
>
<
template
>
<label
id=
"stock-images-upload-box-drag-area"
>
<label
id=
"stock-images-upload-box-drag-area"
>
<div
class=
"holder"
>
<div
class=
"holder"
:class=
"
{dragging: dragging}"
>
<div
class=
"box-centered"
>
<div
class=
"box-centered"
>
<div
class=
"icon-upload"
>
<div
class=
"icon-upload"
>
<studip-icon
shape=
"upload"
:size=
"100"
alt=
""
/>
<studip-icon
shape=
"upload"
:size=
"100"
alt=
""
:role=
"dragging ? 'info_alt' : 'clickable' "
/>
</div>
</div>
<strong>
{{
$gettext
(
'
Bild auswählen oder per Drag & Drop hierher ziehen
'
)
}}
</strong>
<strong>
{{
$gettext
(
'
Bild auswählen oder per Drag & Drop hierher ziehen
'
)
}}
</strong>
<div
class=
"upload-button-holder"
>
<div
class=
"upload-button-holder"
>
<input
type=
"file"
name=
"file"
tabindex=
"-1"
accept=
"image/*"
ref=
"upload"
@
change=
"onUpload"
/>
<input
type=
"file"
name=
"file"
tabindex=
"-1"
accept=
"image/*"
ref=
"upload"
@
change=
"onUpload"
@
dragenter=
"setDragging(true)"
@
dragleave=
"setDragging(false)"
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -16,18 +20,23 @@
...
@@ -16,18 +20,23 @@
<
script
>
<
script
>
export
default
{
export
default
{
data
:
()
=>
({}),
data
:
()
=>
({
dragging
:
false
,
}),
methods
:
{
methods
:
{
onUpload
()
{
onUpload
()
{
const
files
=
this
.
$refs
.
upload
.
files
;
const
files
=
this
.
$refs
.
upload
.
files
;
const
file
=
files
[
0
];
const
file
=
files
[
0
];
this
.
$emit
(
'
upload
'
,
{
file
});
this
.
$emit
(
'
upload
'
,
{
file
});
},
},
setDragging
(
state
)
{
this
.
dragging
=
state
;
},
},
},
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
lang=
"scss"
>
#stock-images-upload-box-drag-area
{
#stock-images-upload-box-drag-area
{
background-color
:
var
(
--
content-color-20
);
background-color
:
var
(
--
content-color-20
);
height
:
100%
;
height
:
100%
;
...
@@ -45,8 +54,16 @@ export default {
...
@@ -45,8 +54,16 @@ export default {
display
:
flex
;
display
:
flex
;
height
:
100%
;
height
:
100%
;
justify-content
:
center
;
justify-content
:
center
;
padding-bottom
:
4px
;
padding
:
0
;
padding
:
0
;
position
:
relative
;
&
.dragging
{
background-color
:
var
(
--
base-color
);
.icon-upload
+
strong
{
color
:
var
(
--
white
);
}
}
}
}
.box-centered
{
.box-centered
{
...
@@ -61,13 +78,17 @@ export default {
...
@@ -61,13 +78,17 @@ export default {
line-height
:
1
.2
;
line-height
:
1
.2
;
display
:
block
;
display
:
block
;
font-weight
:
500
;
font-weight
:
500
;
margin
:
0
0
14px
;
text-align
:
center
;
text-align
:
center
;
margin-left
:
2em
;
margin
:
0
2em
14px
;
margin-right
:
2em
;
}
}
.upload-button-holder
input
[
type
=
'file'
]
{
.upload-button-holder
input
[
type
=
'file'
]
{
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
opacity
:
0
;
opacity
:
0
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
...
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