This repository was archived by the owner on Sep 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,16 @@ angular.module('ui.tinymce', [])
1414 if ( ! attrs . id ) {
1515 attrs . $set ( 'id' , 'uiTinymce' + generatedIds ++ ) ;
1616 }
17+
18+ if ( attrs . uiTinymce ) {
19+ expression = scope . $eval ( attrs . uiTinymce ) ;
20+ } else {
21+ expression = { } ;
22+ }
1723 options = {
1824 // Update model when calling setContent (such as from the source editor popup)
1925 setup : function ( ed ) {
26+ var args ;
2027 ed . on ( 'init' , function ( args ) {
2128 ngModel . $render ( ) ;
2229 } ) ;
@@ -36,15 +43,15 @@ angular.module('ui.tinymce', [])
3643 scope . $apply ( ) ;
3744 }
3845 } ) ;
46+ if ( expression . setup ) {
47+ scope . $eval ( expression . setup ) ;
48+ delete expression . setup ;
49+ }
3950 } ,
4051 mode : 'exact' ,
4152 elements : attrs . id
4253 } ;
43- if ( attrs . uiTinymce ) {
44- expression = scope . $eval ( attrs . uiTinymce ) ;
45- } else {
46- expression = { } ;
47- }
54+ // extend options with initial uiTinymceConfig and options from directive attribute value
4855 angular . extend ( options , uiTinymceConfig , expression ) ;
4956 setTimeout ( function ( ) {
5057 tinymce . init ( options ) ;
You can’t perform that action at this time.
0 commit comments