Commit 57df3965 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Do nothing rather than displaying an error when dropping a folder onto itself

parent 1aac32c8
...@@ -261,8 +261,13 @@ function FileBrowser(idprefix, folderid, config, globalconfig) { ...@@ -261,8 +261,13 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
accept: ['icon-drag-current'], accept: ['icon-drag-current'],
hoverclass: 'folderhover', hoverclass: 'folderhover',
ondrop: function (dragged, dropped) { ondrop: function (dragged, dropped) {
$(self.id + '_move').value = dragged.id.replace(/^.*drag:(\d+)$/, '$1'); var dragid = dragged.id.replace(/^.*drag:(\d+)$/, '$1');
$(self.id + '_moveto').value = dropped.id.replace(/^file:(\d+)$/, '$1'); var dropid = dropped.id.replace(/^file:(\d+)$/, '$1');
if (dragid == dropid) {
return;
}
$(self.id + '_move').value = dragid;
$(self.id + '_moveto').value = dropid;
signal(self.form, 'onsubmit'); signal(self.form, 'onsubmit');
self.form.submit(); self.form.submit();
$(self.id + '_move').value = ''; $(self.id + '_move').value = '';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment