@@ -378,11 +378,16 @@ var MultiColumnWizard = new Class(
378378 var tinyMCEEditors = new Array ( ) ;
379379 var counter = 0 ;
380380
381+ var editorId = 'editorId' ;
382+ if ( tinymce . majorVersion > 3 ) {
383+ editorId = 'id' ;
384+ }
385+
381386 // get a list with tinymces
382387 tinymce . editors . each ( function ( item , index ) {
383- if ( item . editorId . match ( myRegex ) != null )
384- {
385- tinyMCEEditors [ counter ] = item . editorId ;
388+ if ( item [ editorId ] . match ( myRegex ) != null )
389+ {
390+ tinyMCEEditors [ counter ] = item [ editorId ] ;
386391 counter ++ ;
387392 }
388393 } ) ;
@@ -391,7 +396,7 @@ var MultiColumnWizard = new Class(
391396 tinyMCEEditors . each ( function ( item , index ) {
392397 try {
393398 var editor = tinymce . get ( item ) ;
394- $ ( editor . editorId ) . set ( 'text' , editor . getContent ( ) ) ;
399+ $ ( editor [ editorId ] ) . set ( 'text' , editor . getContent ( ) ) ;
395400 editor . remove ( ) ;
396401 } catch ( e ) {
397402 console . log ( e )
@@ -431,10 +436,15 @@ var MultiColumnWizard = new Class(
431436 }
432437
433438 var varTinys = parent . getElements ( '.tinymce textarea' ) ;
434-
435- varTinys . each ( function ( item , index ) {
436-
437- tinymce . execCommand ( 'mceAddControl' , false , item . get ( 'id' ) ) ;
439+
440+ var addEditorCommand = 'mceAddControl' ;
441+ if ( tinymce . majorVersion > 3 ) {
442+ addEditorCommand = 'mceAddEditor' ;
443+ }
444+
445+ varTinys . each ( function ( item , index ) {
446+
447+ tinymce . execCommand ( addEditorCommand , false , item . get ( 'id' ) ) ;
438448 tinymce . get ( item . get ( 'id' ) ) . show ( ) ;
439449 $ ( item . get ( 'id' ) ) . erase ( 'required' ) ;
440450 $ ( tinymce . get ( item . get ( 'id' ) ) . editorContainer ) . getElements ( 'iframe' ) [ 0 ] . set ( 'title' , 'MultiColumnWizard - TinyMCE' ) ;
0 commit comments