diff --git a/lib/rangy-highlighter.js b/lib/rangy-highlighter.js index bde6ba43..6ec4a276 100644 --- a/lib/rangy-highlighter.js +++ b/lib/rangy-highlighter.js @@ -560,7 +560,7 @@ return serializedHighlights.join("|"); }, - deserialize: function(serialized) { + deserialize: function(serialized, cb) { var serializedHighlights = serialized.split("|"); var highlights = []; @@ -605,6 +605,7 @@ highlights.push(highlight); } this.highlights = highlights; + typeof cb === 'function' && cb(); } }; diff --git a/src/modules/rangy-highlighter.js b/src/modules/rangy-highlighter.js index 4527d5d6..37984b84 100644 --- a/src/modules/rangy-highlighter.js +++ b/src/modules/rangy-highlighter.js @@ -549,7 +549,7 @@ rangy.createModule("Highlighter", ["ClassApplier"], function(api, module) { return serializedHighlights.join("|"); }, - deserialize: function(serialized) { + deserialize: function(serialized, cb) { var serializedHighlights = serialized.split("|"); var highlights = []; @@ -594,6 +594,7 @@ rangy.createModule("Highlighter", ["ClassApplier"], function(api, module) { highlights.push(highlight); } this.highlights = highlights; + typeof cb === 'function' && cb(); } };