From db85bfe513eb18133c69713ae2a69b8e8c9ad617 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 17 Dec 2013 13:39:46 +0000 Subject: [PATCH] Fix problem with covering of the dragger image Fixes #253 --- core/modules/widgets/link.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/modules/widgets/link.js b/core/modules/widgets/link.js index c6ec60d28..09ad33e38 100755 --- a/core/modules/widgets/link.js +++ b/core/modules/widgets/link.js @@ -114,13 +114,12 @@ LinkWidget.prototype.handleDragStartEvent = function(event) { this.dragImage.appendChild(inner); this.document.body.appendChild(this.dragImage); // Astoundingly, we need to cover the dragger up: http://www.kryogenix.org/code/browser/custom-drag-image.html - var bounds = this.dragImage.firstChild.getBoundingClientRect(), - cover = this.document.createElement("div"); + var cover = this.document.createElement("div"); cover.className = "tw-tiddler-dragger-cover"; - cover.style.left = (bounds.left - 16) + "px"; - cover.style.top = (bounds.top - 16) + "px"; - cover.style.width = (bounds.width + 32) + "px"; - cover.style.height = (bounds.height + 32) + "px"; + cover.style.left = (inner.offsetLeft - 16) + "px"; + cover.style.top = (inner.offsetTop - 16) + "px"; + cover.style.width = (inner.offsetWidth + 32) + "px"; + cover.style.height = (inner.offsetHeight + 32) + "px"; this.dragImage.appendChild(cover); // Set the data transfer properties var dataTransfer = event.dataTransfer;