* fixes old toolbar usage where $j.wikiEditor is defined
authorMichael Dale <dale@users.mediawiki.org>
Sat, 17 Oct 2009 20:22:34 +0000 (20:22 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Sat, 17 Oct 2009 20:22:34 +0000 (20:22 +0000)
js2/editPage.js

index 1c0d1e0..7775dc0 100644 (file)
@@ -38,14 +38,15 @@ js2AddOnloadHook( function() {
                        }
                    }
                );
-       }else{
-               //add to the old-toolbar
-               if( $j('#btn-add-media-wiz').length == 0 ){
+       }               
+       //add to old toolbar if wikiEditor did not remove '#toolbar' from the page:    
+       setTimeout(function(){                                  
+               if( $j('#btn-add-media-wiz').length == 0 && $j( '#toolbar' ).length != 0 ){
                        $j( '#toolbar' ).append( '<img style="cursor:pointer" id="btn-add-media-wiz" src="' +
                                mv_skin_img_path + 'Button_add_media.png">' );
                        $j( '#btn-add-media-wiz' ).addMediaWiz(
                                amwConf
                        );
                }
-       }
+       },100)
 });