Index: trunk/phase3/js2/editPage.js |
— | — | @@ -24,12 +24,21 @@ |
25 | 25 | init:function(){ |
26 | 26 | var _this = this; |
27 | 27 | //@@todo check for new version of toolbar and via toolbar api: |
28 | | - |
29 | | - //add the add-media-wizard button for old toolbar: |
30 | | - $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">'); |
31 | | - $j('#btn-add-media-wiz').addMediaWiz( |
32 | | - mwAddMediaConfig |
33 | | - ); |
| 28 | + |
| 29 | + //kind of tricky would be nice to use a "loader" call here to avoid concurancy issues. |
| 30 | + if( typeof $j.wikiEditor != 'undefined' ){ |
| 31 | + setTimeout(function(){ |
| 32 | + $j('.wikiEditor-ui [rel=file]').addMediaWiz( |
| 33 | + mwAddMediaConfig |
| 34 | + ); |
| 35 | + },100 ); |
| 36 | + }else{ |
| 37 | + //add the add-media-wizard button for old toolbar: |
| 38 | + $j('#toolbar').append('<img style="cursor:pointer" id="btn-add-media-wiz" src="' + mv_skin_img_path + 'Button_add_media.png">'); |
| 39 | + $j('#btn-add-media-wiz').addMediaWiz( |
| 40 | + mwAddMediaConfig |
| 41 | + ); |
| 42 | + } |
34 | 43 | |
35 | 44 | //add to new toolbar (need to use api) |
36 | 45 | /*$j('[rel=insert] tool-file').addMediaWiz( |