File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ angular
11
11
if ( ! element . hasClass ( 'processed' ) ) {
12
12
element . addClass ( 'processed' ) ;
13
13
14
- // Setup the markdown WYSIWYG.
15
- element . markdown ( {
14
+ var markdownOptions = {
16
15
autofocus : options . autofocus || false ,
17
16
saveable : options . saveable || false ,
18
17
savable : options . savable || false ,
@@ -63,7 +62,17 @@ angular
63
62
runScopeFunction ( scope , attrs . onShow , e ) ;
64
63
}
65
64
}
66
- } ) ;
65
+ } ;
66
+
67
+ // Setup the markdown WYSIWYG.
68
+
69
+ // if the markdown editor was added dynamically the markdown function will be undefined
70
+ // so it has to be called explicitely
71
+ if ( element . markdown === undefined ) {
72
+ element . data ( 'markdown' , ( data = new $ . fn . markdown . Constructor ( element [ 0 ] , markdownOptions ) ) )
73
+ } else {
74
+ element . markdown ( markdownOptions ) ;
75
+ }
67
76
}
68
77
}
69
78
} ;
You can’t perform that action at this time.
0 commit comments