@@ -54,9 +54,7 @@ define([
54
54
window . tinyMceEditors = $H ( { } ) ;
55
55
}
56
56
57
- if ( ! tinyMceEditors . get ( this . id ) ) {
58
- tinyMceEditors . set ( this . id , this ) ;
59
- }
57
+ tinyMceEditors . set ( this . id , this ) ;
60
58
} ,
61
59
62
60
/**
@@ -76,11 +74,6 @@ define([
76
74
77
75
this . turnOff ( ) ;
78
76
79
- if ( ! tinyMCE ) {
80
- console . error ( 'TinyMCE is not loaded' ) ;
81
- return ;
82
- }
83
-
84
77
if ( this . config . plugins ) {
85
78
this . config . plugins . forEach ( function ( plugin ) {
86
79
var deferred ;
@@ -122,15 +115,11 @@ define([
122
115
}
123
116
124
117
jQuery . when . apply ( jQuery , deferreds ) . done ( function ( ) {
125
- try {
126
- tinyMCE . init ( settings ) ;
127
- this . getPluginButtons ( ) . hide ( ) ;
128
- varienGlobalEvents . clearEventHandlers ( 'open_browser_callback' ) ;
129
- this . eventBus . clearEventHandlers ( 'open_browser_callback' ) ;
130
- this . eventBus . attachEventHandler ( 'open_browser_callback' , tinyMceEditors . get ( self . id ) . openFileBrowser ) ;
131
- } catch ( e ) {
132
- console . error ( 'Error initializing TinyMCE:' , e ) ;
133
- }
118
+ tinyMCE . init ( settings ) ;
119
+ this . getPluginButtons ( ) . hide ( ) ;
120
+ varienGlobalEvents . clearEventHandlers ( 'open_browser_callback' ) ;
121
+ this . eventBus . clearEventHandlers ( 'open_browser_callback' ) ;
122
+ this . eventBus . attachEventHandler ( 'open_browser_callback' , tinyMceEditors . get ( self . id ) . openFileBrowser ) ;
134
123
} . bind ( this ) ) ;
135
124
} ,
136
125
@@ -415,16 +404,16 @@ define([
415
404
416
405
require ( [ 'mage/adminhtml/browser' ] , function ( ) {
417
406
MediabrowserUtility . openDialog ( wUrl , false , false , typeTitle , {
418
- /**
407
+ /**
419
408
* Closed.
420
409
*/
421
- closed : function ( ) {
422
- frameDialog . show ( ) ;
423
- jQuery ( '.tox-tinymce-aux' ) . show ( ) ;
424
- } ,
410
+ closed : function ( ) {
411
+ frameDialog . show ( ) ;
412
+ jQuery ( '.tox-tinymce-aux' ) . show ( ) ;
413
+ } ,
425
414
426
- targetElementId : self . activeEditor ( ) ? self . activeEditor ( ) . id : null
427
- }
415
+ targetElementId : self . activeEditor ( ) ? self . activeEditor ( ) . id : null
416
+ }
428
417
) ;
429
418
} ) ;
430
419
} ,
@@ -496,9 +485,7 @@ define([
496
485
497
486
this . getPluginButtons ( ) . show ( ) ;
498
487
499
- if ( tinyMCE && tinyMCE . get ( this . getId ( ) ) ) {
500
- tinyMCE . execCommand ( 'mceRemoveEditor' , false , this . getId ( ) ) ;
501
- }
488
+ tinyMCE . execCommand ( 'mceRemoveEditor' , false , this . getId ( ) ) ;
502
489
503
490
return this ;
504
491
} ,
0 commit comments