editro
Advanced tools
Comparing version 2.0.31 to 2.0.32
{ | ||
"name": "editro", | ||
"version": "2.0.31", | ||
"version": "2.0.32", | ||
"description": "HTML WYSIWYG editor in HTML", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -46,5 +46,6 @@ const { debounce } = require('../utils'); | ||
cm.on('changes', debounce(() => { | ||
const v = cm.getValue(); | ||
if (v !== editro.getHtml()) { | ||
editro.setHtml(v, { | ||
const codeMirrorSource = cm.getValue(); | ||
if (editro.frame && editro.frame.isDocumentReady() && codeMirrorSource !== editro.getHtml()) { | ||
editro.setHtml(codeMirrorSource, { | ||
sourceType: 'code' | ||
@@ -51,0 +52,0 @@ }); |
const Element = require('./Element'); | ||
const EventEmmiter = require('events'); | ||
const { debounce } = require('./utils'); | ||
const DOCUMENT_READYSTATE_LOADING = 'loading'; | ||
@@ -91,2 +92,8 @@ class Frame extends EventEmmiter { | ||
isDocumentReady() { | ||
const doc = this.node.contentDocument; | ||
return doc && doc.readyState && doc.readyState !== DOCUMENT_READYSTATE_LOADING; | ||
} | ||
_select(node, silenced) { | ||
@@ -93,0 +100,0 @@ if (this.current.el) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
38527
1440711