|
|
|
@ -307,16 +307,17 @@
|
|
|
|
|
insertHTML: function (html) { |
|
|
|
|
var range = this.getRng(); |
|
|
|
|
|
|
|
|
|
if (document.queryCommandState("insertHTML")) { |
|
|
|
|
// W3C
|
|
|
|
|
try { |
|
|
|
|
this.nicCommand("insertHTML", html); |
|
|
|
|
} else if (range.insertNode) { |
|
|
|
|
// IE
|
|
|
|
|
range.deleteContents(); |
|
|
|
|
range.insertNode($(html)[0]); |
|
|
|
|
} else if (range.pasteHTML) { |
|
|
|
|
// IE <= 10
|
|
|
|
|
range.pasteHTML(html); |
|
|
|
|
} finally { |
|
|
|
|
if (range.insertNode) { |
|
|
|
|
// IE
|
|
|
|
|
range.deleteContents(); |
|
|
|
|
range.insertNode($(html)[0]); |
|
|
|
|
} else if (range.pasteHTML) { |
|
|
|
|
// IE <= 10
|
|
|
|
|
range.pasteHTML(html); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|