fix fields being overwritten when dropping

remove the unneeded setFocus() call which was causing the blur event
to fire with the wrong data
This commit is contained in:
Damien Elmes 2017-08-01 17:40:51 +10:00
parent 66500f5262
commit 9ec9274011
2 changed files with 5 additions and 2 deletions

View file

@ -622,9 +622,8 @@ to a cloze type first, via Edit>Change Note Type."""))
self.web.eval("pasteHTML(%s);" % json.dumps(html))
def doDrop(self, html, internal):
self.web.evalWithCallback("dropTarget.focus();",
self.web.evalWithCallback("makeDropTargetCurrent();",
lambda _: self.doPaste(html, internal))
self.web.setFocus()
def onPaste(self):
self.web.onPaste()

View file

@ -154,6 +154,10 @@ function onDragOver(elem) {
dropTarget = elem;
}
function makeDropTargetCurrent() {
dropTarget.focus();
}
function onPaste(elem) {
pycmd("paste");
window.event.preventDefault();