From 16bb474fef561a41ae0dafb5247a3dc5f559ee5c Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Sat, 2 Mar 2019 16:13:36 +0100 Subject: [PATCH] Partial fix for the sticky dropzone on firefox (#3809) in my tests listening for the dragend event and removing the tc-dragover class in that case removes the `tc-dragover` every time it should ... without this, firefox often doesn't remove it and the green bar sticks at the top investigating now if the droppable widget has a similar problem --- core/modules/widgets/dropzone.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/dropzone.js b/core/modules/widgets/dropzone.js index 7968f5a44..c4cb36262 100644 --- a/core/modules/widgets/dropzone.js +++ b/core/modules/widgets/dropzone.js @@ -42,7 +42,8 @@ DropZoneWidget.prototype.render = function(parent,nextSibling) { {name: "dragover", handlerObject: this, handlerMethod: "handleDragOverEvent"}, {name: "dragleave", handlerObject: this, handlerMethod: "handleDragLeaveEvent"}, {name: "drop", handlerObject: this, handlerMethod: "handleDropEvent"}, - {name: "paste", handlerObject: this, handlerMethod: "handlePasteEvent"} + {name: "paste", handlerObject: this, handlerMethod: "handlePasteEvent"}, + {name: "dragend", handlerObject: this, handlerMethod: "handleDragEndEvent"} ]); domNode.addEventListener("click",function (event) { },false); @@ -103,6 +104,10 @@ DropZoneWidget.prototype.handleDragLeaveEvent = function(event) { this.leaveDrag(event); }; +DropZoneWidget.prototype.handleDragEndEvent = function(event) { + $tw.utils.removeClass(this.domNodes[0],"tc-dragover"); +}; + DropZoneWidget.prototype.handleDropEvent = function(event) { var self = this, readFileCallback = function(tiddlerFieldsArray) {