Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7c36adbb
authored
May 18, 2018
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We cannot have one button/input type for both folders and files for upload
1 parent
3df9f8a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
frontend/index.html
frontend/js/app.js
frontend/index.html
View file @
7c36adb
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
<div
id=
"app"
@
drop=
"drop"
@
dragover=
"dragOver"
>
<div
id=
"app"
@
drop=
"drop"
@
dragover=
"dragOver"
>
<el-container>
<el-container>
<input
type=
"file"
ref=
"upload"
style=
"display: none"
id=
"uploadInput"
multiple
webkitdirectory=
""
directory=
""
/>
<input
type=
"file"
ref=
"upload"
style=
"display: none"
multiple
/>
<input
type=
"file"
ref=
"uploadFolder"
style=
"display: none"
multiple
webkitdirectory
directory
/>
<el-dialog
title=
"Login"
:visible
.
sync=
"ready && !session.valid"
width=
"30%"
:close-on-press-escape=
"false"
:show-close=
"false"
>
<el-dialog
title=
"Login"
:visible
.
sync=
"ready && !session.valid"
width=
"30%"
:close-on-press-escape=
"false"
:show-close=
"false"
>
<el-form
:model=
"loginData"
label-position=
"top"
@
submit
.
native
.
prevent
>
<el-form
:model=
"loginData"
label-position=
"top"
@
submit
.
native
.
prevent
>
...
@@ -51,7 +52,8 @@
...
@@ -51,7 +52,8 @@
</div>
</div>
<div
align=
"right"
v-show=
"session.valid"
>
<div
align=
"right"
v-show=
"session.valid"
>
<el-button-group>
<el-button-group>
<el-button
type=
"primary"
icon=
"el-icon-upload"
size=
"small"
@
click=
"onUpload"
>
Upload
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-upload2"
size=
"small"
@
click=
"onUpload"
>
Upload File
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-upload"
size=
"small"
@
click=
"onUploadFolder"
>
Upload Folder
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"small"
@
click=
"onNewFolder"
>
New Folder
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"small"
@
click=
"onNewFolder"
>
New Folder
</el-button>
</el-button-group>
</el-button-group>
<el-dropdown
@
command=
"onOptionsMenu"
>
<el-dropdown
@
command=
"onOptionsMenu"
>
...
...
frontend/js/app.js
View file @
7c36adb
...
@@ -256,10 +256,8 @@ var app = new Vue({
...
@@ -256,10 +256,8 @@ var app = new Vue({
var
that
=
this
;
var
that
=
this
;
$
(
this
.
$refs
.
upload
).
on
(
'change'
,
function
()
{
$
(
this
.
$refs
.
upload
).
on
(
'change'
,
function
()
{
// detach event handler
// detach event handler
$
(
that
.
$refs
.
upload
).
off
(
'change'
);
$
(
that
.
$refs
.
upload
).
off
(
'change'
);
uploadFiles
(
that
.
$refs
.
upload
.
files
||
[]);
uploadFiles
(
that
.
$refs
.
upload
.
files
||
[]);
});
});
...
@@ -267,6 +265,19 @@ var app = new Vue({
...
@@ -267,6 +265,19 @@ var app = new Vue({
this
.
$refs
.
upload
.
value
=
''
;
this
.
$refs
.
upload
.
value
=
''
;
this
.
$refs
.
upload
.
click
();
this
.
$refs
.
upload
.
click
();
},
},
onUploadFolder
:
function
()
{
var
that
=
this
;
$
(
this
.
$refs
.
uploadFolder
).
on
(
'change'
,
function
()
{
// detach event handler
$
(
that
.
$refs
.
uploadFolder
).
off
(
'change'
);
uploadFiles
(
that
.
$refs
.
uploadFolder
.
files
||
[]);
});
// reset the form first to make the change handler retrigger even on the same file selected
this
.
$refs
.
uploadFolder
.
value
=
''
;
this
.
$refs
.
uploadFolder
.
click
();
},
onDelete
:
function
(
entry
)
{
onDelete
:
function
(
entry
)
{
var
that
=
this
;
var
that
=
this
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment