mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
remove insertHtmlOK hack; focus handling seems to have fixed this
This commit is contained in:
parent
ff28fdd189
commit
c6c938a262
1 changed files with 1 additions and 10 deletions
|
|
@ -47,7 +47,6 @@ body { margin: 5px; }
|
||||||
|
|
||||||
var currentField = null;
|
var currentField = null;
|
||||||
var changeTimer = null;
|
var changeTimer = null;
|
||||||
var insertHTMLOK = %s;
|
|
||||||
var dropTarget = null;
|
var dropTarget = null;
|
||||||
|
|
||||||
String.prototype.format = function() {
|
String.prototype.format = function() {
|
||||||
|
|
@ -176,14 +175,7 @@ function wrap(front, back) {
|
||||||
var span = document.createElement("span")
|
var span = document.createElement("span")
|
||||||
span.appendChild(content);
|
span.appendChild(content);
|
||||||
var new_ = wrappedExceptForWhitespace(span.innerHTML, front, back);
|
var new_ = wrappedExceptForWhitespace(span.innerHTML, front, back);
|
||||||
if (insertHTMLOK) {
|
setFormat("inserthtml", new_);
|
||||||
setFormat("inserthtml", new_);
|
|
||||||
} else {
|
|
||||||
r.deleteContents();
|
|
||||||
r.collapse(true);
|
|
||||||
r.insertNode(document.createTextNode(new_));
|
|
||||||
saveField('key');
|
|
||||||
}
|
|
||||||
if (!span.innerHTML) {
|
if (!span.innerHTML) {
|
||||||
// run with an empty selection; move cursor back past postfix
|
// run with an empty selection; move cursor back past postfix
|
||||||
r = s.getRangeAt(0);
|
r = s.getRangeAt(0);
|
||||||
|
|
@ -546,7 +538,6 @@ class Editor(object):
|
||||||
if self.note:
|
if self.note:
|
||||||
self.web.setHtml(_html % (
|
self.web.setHtml(_html % (
|
||||||
getBase(self.mw.col), fontForPlatform(), anki.js.jquery,
|
getBase(self.mw.col), fontForPlatform(), anki.js.jquery,
|
||||||
(isMac or isWin) and 1 or 0,
|
|
||||||
_("Show Duplicates")), loadCB=self._loadFinished)
|
_("Show Duplicates")), loadCB=self._loadFinished)
|
||||||
self.updateTagsAndDeck()
|
self.updateTagsAndDeck()
|
||||||
self.updateKeyboard()
|
self.updateKeyboard()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue