Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fixing drag and drop issues in node-webkit

Ilian339ea2c2b9eb
diff --git a/data/ext/perspectiveGrid/perspectiveUI.js b/data/ext/perspectiveGrid/perspectiveUI.js
index dc0d21f1b..3261cfa57 100644
--- a/data/ext/perspectiveGrid/perspectiveUI.js
+++ b/data/ext/perspectiveGrid/perspectiveUI.js
@@ -554,7 +554,7 @@ console.log("Loading UI for perspectiveDefault");
TSCORE.TagUtils.addTag(TSCORE.selectedFiles, [tagName]);
self.handleElementActivation();
- $(ui.helper).remove();
+ //$(ui.helper).remove();
}
})
);
diff --git a/data/ext/perspectiveList/perspectiveUI.js b/data/ext/perspectiveList/perspectiveUI.js
index 07ba0253d..40e006bca 100644
--- a/data/ext/perspectiveList/perspectiveUI.js
+++ b/data/ext/perspectiveList/perspectiveUI.js
@@ -227,6 +227,7 @@ console.log("Loading UI for perspectiveList");
accept: ".tagButton",
hoverClass: "activeRow",
drop: function( event, ui ) {
+
var tagName = TSCORE.selectedTag;
var targetFilePath = $(this).find(".fileTitleButton").attr("filepath");
@@ -245,7 +246,7 @@ console.log("Loading UI for perspectiveList");
TSCORE.TagUtils.addTag(TSCORE.selectedFiles, [tagName]);
self.handleElementActivation();
- $(ui.helper).remove();
+ //$(ui.helper).remove();
}
})
.hammer().on("doubletap", function(event) {
diff --git a/data/js/fileopener.js b/data/js/fileopener.js
index c7e313500..26e81883f 100644
--- a/data/js/fileopener.js
+++ b/data/js/fileopener.js
@@ -332,7 +332,8 @@ define(function(require, exports, module) {
drop: function( event, ui ) {
console.log("Tagging file: "+TSCORE.selectedTag+" to "+_openedFilePath);
TSCORE.TagUtils.addTag([_openedFilePath], [TSCORE.selectedTag]);
- $(ui.helper).remove();
+
+ //$(ui.helper).remove();
}
});
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 35bc5e5d8..37b5aabca 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -205,6 +205,7 @@ define(function(require, exports, module) {
accept: '.tagButton',
hoverClass: "dirButtonActive",
drop: function( event, ui ) {
+ ui.draggable.detach();
var tagGroupData = TSCORE.Config.getTagData(ui.draggable.attr("tag"), ui.draggable.attr("parentKey"));
tagGroupData.parentKey = ui.draggable.attr("parentKey");
var targetTagGroupKey = $(this).attr("key");
@@ -269,7 +270,7 @@ define(function(require, exports, module) {
"appendTo": "body",
"helper": "clone",
"revert": 'invalid',
- "start": function(e, ui) {
+ "drop": function(e, ui) {
TSCORE.selectedTagData = TSCORE.Config.getTagData($(this).attr("tag"), $(this).attr("parentKey"));
TSCORE.selectedTag = generateTagValue(TSCORE.selectedTagData);
TSCORE.selectedTagData.parentKey = $(this).attr("parentKey");