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
1111 if ( ! element . hasClass ( 'processed' ) ) {
1212 element . addClass ( 'processed' ) ;
1313
14- // Setup the markdown WYSIWYG.
15- element . markdown ( {
14+ var markdownOptions = {
1615 autofocus : options . autofocus || false ,
1716 saveable : options . saveable || false ,
1817 savable : options . savable || false ,
@@ -63,7 +62,17 @@ angular
6362 runScopeFunction ( scope , attrs . onShow , e ) ;
6463 }
6564 }
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+ }
6776 }
6877 }
6978 } ;
You can’t perform that action at this time.
0 commit comments