Commit 810870da authored by Fabian-Andree Heidemann's avatar Fabian-Andree Heidemann
Browse files

[filebrowser] simplify drag and drop CSSing, symbol view bug still TODO

parent 4217775b
......@@ -230,39 +230,20 @@ define(["jquery", "jclass"], function($, JClass) {
// dragend
node.on("dragend", function(event) {
event.preventDefault();
// remove all potential set css classes from selected items
var selectedItems = Object.keys(self.FileBase.selections.entries);
var i;
for (i = 0; i < selectedItems.length; i++) {
$(self.FileBase.selections.entries[selectedItems[i]]).toggleClass(
"stop-pointer-events", false);
$(self.FileBase.selections.entries[selectedItems[i]]).toggleClass("dragstart", false);
$(self.FileBase.selections.entries[selectedItems[i]]).toggleClass("dragover", false);
}
// remove all potential set css classes from element on which dragend occurs
node.toggleClass("stop-pointer-events", false);
node.toggleClass("dragstart", false);
node.toggleClass("dragover", false);
// remove all potential set css classes
node.parent().toggleClass("dragover", false);
node.siblings().toggleClass("dragover dragstart stop-pointer-events", false);
node.toggleClass("dragover dragstart stop-pointer-events", false);
});
// drop
node.on("drop", function(event) {
event.preventDefault();
// remove potentially set css classes from selected items
var selectedItems = Object.keys(self.FileBase.selections.entries);
var i;
for (i = 0; i < selectedItems.length; i++) {
$(self.FileBase.selections.entries[selectedItems[i]]).toggleClass(
"stop-pointer-events", false);
$(self.FileBase.selections.entries[selectedItems[i]]).toggleClass("dragstart", false);
$(self.FileBase.selections.entries[selectedItems[i]]).toggleClass("dragover", false);
}
// remove potentially set css classes from item on which drop occurs (= target)
node.toggleClass("stop-pointer-events", false);
node.toggleClass("dragstart", false);
node.toggleClass("dragover", false);
// remove all potential set css classes
node.parent().toggleClass("dragover", false);
node.siblings().toggleClass("dragover dragstart stop-pointer-events", false);
node.toggleClass("dragover dragstart stop-pointer-events", false);
// get file which was dragged and now dropped
var fileToBeMoved = (event.originalEvent.dataTransfer.getData("dataName"));
// if transfered data empty: no drag but upload
......
Markdown is supported
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