|
@@ -624,7 +624,7 @@ from django.utils.translation import ugettext as _
|
|
|
|
|
|
|
|
if (destpath) {
|
|
if (destpath) {
|
|
|
$('#moveDestination').val(destpath);
|
|
$('#moveDestination').val(destpath);
|
|
|
- viewModel.move('nomodal');
|
|
|
|
|
|
|
+ viewModel.move('nomodal', _dragged);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -1194,7 +1194,7 @@ from django.utils.translation import ugettext as _
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- self.move = function (mode) {
|
|
|
|
|
|
|
+ self.move = function (mode, unselectedDrag) {
|
|
|
var paths = [];
|
|
var paths = [];
|
|
|
|
|
|
|
|
var isMoveOnSelf = false;
|
|
var isMoveOnSelf = false;
|
|
@@ -1205,6 +1205,10 @@ from django.utils.translation import ugettext as _
|
|
|
paths.push(file.path);
|
|
paths.push(file.path);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ if (paths.length == 0 && typeof unselectedDrag !== 'undefined'){
|
|
|
|
|
+ paths.push(_dragged.path);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (!isMoveOnSelf){
|
|
if (!isMoveOnSelf){
|
|
|
hiddenFields($("#moveForm"), "src_path", paths);
|
|
hiddenFields($("#moveForm"), "src_path", paths);
|
|
|
|
|
|
|
@@ -1579,7 +1583,9 @@ from django.utils.translation import ugettext as _
|
|
|
// Place all values into hidden fields under parent element.
|
|
// Place all values into hidden fields under parent element.
|
|
|
// Looks for managed hidden fields and handles sizing appropriately.
|
|
// Looks for managed hidden fields and handles sizing appropriately.
|
|
|
var hiddenFields = function (parentEl, name, values) {
|
|
var hiddenFields = function (parentEl, name, values) {
|
|
|
- parentEl = $(parentEl);
|
|
|
|
|
|
|
+ if (!(parentEl instanceof jQuery)){
|
|
|
|
|
+ parentEl = $(parentEl);
|
|
|
|
|
+ }
|
|
|
parentEl.find("input.hidden-field").remove();
|
|
parentEl.find("input.hidden-field").remove();
|
|
|
|
|
|
|
|
$(values).each(function (index, value) {
|
|
$(values).each(function (index, value) {
|