From 8ef1e417388a072a32ccb9b47748df92abd69434 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Mon, 7 Sep 2009 17:05:48 +0000 Subject: [PATCH] quick hack for addMediaWiz compatibility with usability toolbar --- js2/editPage.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/js2/editPage.js b/js2/editPage.js index e7055ba053..4deebbcb28 100644 --- a/js2/editPage.js +++ b/js2/editPage.js @@ -24,12 +24,21 @@ var mwEditPageHelper = { init:function(){ var _this = this; //@@todo check for new version of toolbar and via toolbar api: - - //add the add-media-wizard button for old toolbar: - $j('#toolbar').append(''); - $j('#btn-add-media-wiz').addMediaWiz( - mwAddMediaConfig - ); + + //kind of tricky would be nice to use a "loader" call here to avoid concurancy issues. + if( typeof $j.wikiEditor != 'undefined' ){ + setTimeout(function(){ + $j('.wikiEditor-ui [rel=file]').addMediaWiz( + mwAddMediaConfig + ); + },100 ); + }else{ + //add the add-media-wizard button for old toolbar: + $j('#toolbar').append(''); + $j('#btn-add-media-wiz').addMediaWiz( + mwAddMediaConfig + ); + } //add to new toolbar (need to use api) /*$j('[rel=insert] tool-file').addMediaWiz( -- 2.20.1