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', [])
14
14
if ( ! attrs . id ) {
15
15
attrs . $set ( 'id' , 'uiTinymce' + generatedIds ++ ) ;
16
16
}
17
+
18
+ if ( attrs . uiTinymce ) {
19
+ expression = scope . $eval ( attrs . uiTinymce ) ;
20
+ } else {
21
+ expression = { } ;
22
+ }
17
23
options = {
18
24
// Update model when calling setContent (such as from the source editor popup)
19
25
setup : function ( ed ) {
26
+ var args ;
20
27
ed . on ( 'init' , function ( args ) {
21
28
ngModel . $render ( ) ;
22
29
} ) ;
@@ -36,15 +43,15 @@ angular.module('ui.tinymce', [])
36
43
scope . $apply ( ) ;
37
44
}
38
45
} ) ;
46
+ if ( expression . setup ) {
47
+ scope . $eval ( expression . setup ) ;
48
+ delete expression . setup ;
49
+ }
39
50
} ,
40
51
mode : 'exact' ,
41
52
elements : attrs . id
42
53
} ;
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
48
55
angular . extend ( options , uiTinymceConfig , expression ) ;
49
56
setTimeout ( function ( ) {
50
57
tinymce . init ( options ) ;
You can’t perform that action at this time.
0 commit comments