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;