Skip to content

Commit a686269

Browse files
committed
Merge branch 't/11149' into major
2 parents ed68fde + 5fe814b commit a686269

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

plugins/magicline/plugin.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,21 @@
277277

278278
// Revert magicline hot node on undo/redo.
279279
editor.on( 'loadSnapshot', function( event ) {
280-
var elements = editor.document.find( 'p,br,div' ),
281-
element;
282-
283-
for ( var i = elements.count(); i--; ) {
284-
if ( ( element = elements.getItem( i ) ).data( 'cke-magicline-hot' ) ) {
285-
// Restore hotNode
286-
that.hotNode = element;
287-
// Restore last access direction
288-
that.lastCmdDirection = element.data( 'cke-magicline-dir' ) === 'true' ? true : false;
289-
break;
280+
var elements, element, i;
281+
282+
for ( var t in { p:1,br:1,div:1 } ) {
283+
// document.find is not available in QM (#11149).
284+
elements = doc.getElementsByTag( t );
285+
286+
for ( i = elements.count(); i--; ) {
287+
if ( ( element = elements.getItem( i ) ).data( 'cke-magicline-hot' ) ) {
288+
// Restore hotNode
289+
that.hotNode = element;
290+
// Restore last access direction
291+
that.lastCmdDirection = element.data( 'cke-magicline-dir' ) === 'true' ? true : false;
292+
293+
return;
294+
}
290295
}
291296
}
292297
} );

0 commit comments

Comments
 (0)