mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
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:
parent
66500f5262
commit
9ec9274011
2 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
|
|
|
@ -154,6 +154,10 @@ function onDragOver(elem) {
|
|||
dropTarget = elem;
|
||||
}
|
||||
|
||||
function makeDropTargetCurrent() {
|
||||
dropTarget.focus();
|
||||
}
|
||||
|
||||
function onPaste(elem) {
|
||||
pycmd("paste");
|
||||
window.event.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue