1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 01:20:30 +00:00

Fix problem with dragging partially selected link

Fixes #841
This commit is contained in:
Jermolene 2014-09-14 10:50:53 +01:00
parent 320e0af68c
commit 2571f534aa

View File

@ -124,6 +124,7 @@ LinkWidget.prototype.handleClickEvent = function (event) {
};
LinkWidget.prototype.handleDragStartEvent = function(event) {
if(event.target === this.domNodes[0]) {
if(this.to) {
// Set the dragging class on the element being dragged
$tw.utils.addClass(event.target,"tc-tiddlylink-dragging");
@ -166,15 +167,18 @@ LinkWidget.prototype.handleDragStartEvent = function(event) {
} else {
event.preventDefault();
}
}
};
LinkWidget.prototype.handleDragEndEvent = function(event) {
if(event.target === this.domNodes[0]) {
// Remove the dragging class on the element being dragged
$tw.utils.removeClass(event.target,"tc-tiddlylink-dragging");
// Delete the drag image element
if(this.dragImage) {
this.dragImage.parentNode.removeChild(this.dragImage);
}
}
};
/*