Commit fa5c2fac authored by bbaer's avatar bbaer
Browse files

Some expansions

parent 904ecb38
......@@ -40,11 +40,19 @@ var QfqNS = QfqNS || {};
e.preventDefault();
$dropArea.addClass("qfqTargetDisplay");
});
$dropArea.on("dragover", function(e) {
e.preventDefault();
e.originalEvent.dataTransfer.dropEffect = "move";
});
$dropArea.on("dragleave", function(e) {
e.preventDefault();
$dropArea.removeClass("qfqTargetDisplay");
});
$dropArea.on("drop", function() { that.updateOrder($(this));});
$dropArea.on("drop", function(e) {
e.preventDefault();
console.log("Boom");
that.updateOrder(e, $dropArea);
});
return $dropArea;
};
......@@ -54,6 +62,11 @@ var QfqNS = QfqNS || {};
this.$container.children().each( function() {
var child = $(this);
child.prop("draggable", true);
child.on("dragstart", function(e) {
console.log(e);
e.originalEvent.dataTransfer.setData("text", child.id);
e.originalEvent.dataTransfer.effectAllowed = "move";
});
var $dropArea = that.buildDropArea();
child.before($dropArea);
});
......@@ -61,8 +74,9 @@ var QfqNS = QfqNS || {};
$dropArea.appendTo(this.$container);
};
n.DragAndDrop.prototype.updateOrder = function($hook) {
console.log($hook);
n.DragAndDrop.prototype.updateOrder = function(e, $hook) {
console.log(e.dataTransfer.getData("text"));
console.log($hook);
};
......
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