Make undoing a cloze operation behave more intuitively

Prior to this change, undoing the clozeing of a block of text would
delete the text altogether.  We'd prefer it to revert to unclozed text.
This commit is contained in:
Aaron Harsh 2012-01-29 19:34:50 -08:00
parent a87e55e977
commit 50e6fade55

View file

@ -127,7 +127,7 @@ function wrap(front, back) {
setFormat('removeFormat', null, true); setFormat('removeFormat', null, true);
var s = window.getSelection(); var s = window.getSelection();
var r = s.getRangeAt(0); var r = s.getRangeAt(0);
var content = r.extractContents(); var content = r.cloneContents();
var span = document.createElement("span") var span = document.createElement("span")
span.appendChild(content); span.appendChild(content);
s.removeAllRanges(); s.removeAllRanges();