Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
a6c92de1
Commit
a6c92de1
authored
Oct 18, 2014
by
asseldonk
Browse files
filebrowser: only move files when source and destination path is unequal
parent
e874aac0
Changes
1
Hide whitespace changes
Inline
Side-by-side
vispa/extensions/file/static/js/base/events.js
View file @
a6c92de1
...
...
@@ -202,6 +202,7 @@ var FileBaseEvents = Class.extend({
event
.
preventDefault
();
$
(
node
).
removeClass
(
"
file-dragover
"
);
fileToBeMoved
=
(
event
.
originalEvent
.
dataTransfer
.
getData
(
'
dataName
'
));
// if transfered data empty: upload
if
(
fileToBeMoved
==
""
)
{
if
(
data
.
type
==
"
d
"
)
{
var
path
=
self
.
FileBase
.
workflow
.
path
+
'
/
'
+
data
.
name
;
...
...
@@ -209,10 +210,14 @@ var FileBaseEvents = Class.extend({
var
path
=
self
.
FileBase
.
workflow
.
path
;
}
self
.
FileBase
.
actions
.
upload
(
path
);
}
else
{
var
source
=
self
.
FileBase
.
workflow
.
path
+
'
/
'
+
fileToBeMoved
;
var
destination
=
self
.
FileBase
.
workflow
.
path
+
'
/
'
+
data
.
name
;
self
.
FileBase
.
actions
.
move
(
source
,
destination
);
}
// if transfered data not empty: move
else
{
if
(
data
.
type
==
"
d
"
)
{
var
source
=
self
.
FileBase
.
workflow
.
path
+
'
/
'
+
fileToBeMoved
;
var
destination
=
self
.
FileBase
.
workflow
.
path
+
'
/
'
+
data
.
name
;
self
.
FileBase
.
actions
.
move
(
source
,
destination
);
}
}
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment