equal
deleted
inserted
replaced
289 throw new Error( 'Failed to initialize editor' ); |
289 throw new Error( 'Failed to initialize editor' ); |
290 } |
290 } |
291 onInit = function() { |
291 onInit = function() { |
292 |
292 |
293 // When a widget is moved in the DOM the dynamically-created TinyMCE iframe will be destroyed and has to be re-built. |
293 // When a widget is moved in the DOM the dynamically-created TinyMCE iframe will be destroyed and has to be re-built. |
294 $( editor.getWin() ).on( 'unload', function() { |
294 $( editor.getWin() ).on( 'pagehide', function() { |
295 _.defer( buildEditor ); |
295 _.defer( buildEditor ); |
296 }); |
296 }); |
297 |
297 |
298 // If a prior mce instance was replaced, and it was in text mode, toggle to text mode. |
298 // If a prior mce instance was replaced, and it was in text mode, toggle to text mode. |
299 if ( restoreTextMode ) { |
299 if ( restoreTextMode ) { |