Index: trunk/extensions/JS2Support/mwEmbed/mwEmbed.js |
— | — | @@ -839,9 +839,9 @@ |
840 | 840 | |
841 | 841 | // If ( debug mode ) and the script include is missing class messages |
842 | 842 | // do a separate request to retrieve the msgs |
843 | | - if( mw.currentClassMissingMessages ){ |
844 | | - mw.loadClassMessages( className, function(){ |
845 | | - //reset the currentClassMissingMessages flag |
| 843 | + if( mw.currentClassMissingMessages ){ |
| 844 | + mw.loadClassMessages( className, function(){ |
| 845 | + // Reset the currentClassMissingMessages flag |
846 | 846 | mw.currentClassMissingMessages = false; |
847 | 847 | // Run the onDone callback |
848 | 848 | mw.loadDone( className ); |
— | — | @@ -851,8 +851,7 @@ |
852 | 852 | // is not able to append the loadDone call |
853 | 853 | mw.loadDone( className ); |
854 | 854 | } |
855 | | - } ); |
856 | | - //mw.log( 'done with running getScript request ' ); |
| 855 | + } ); |
857 | 856 | |
858 | 857 | /* |
859 | 858 | * ( If scriptLoader is not enabled ) |
— | — | @@ -860,14 +859,18 @@ |
861 | 860 | * Check if the class is ready: |
862 | 861 | * ( not all browsers support onLoad script attribute ) |
863 | 862 | * In the case of a "class" we can pull the javascript state until its ready |
| 863 | + * |
| 864 | + * If we are waiting for msgs we can't support "class" defined check |
864 | 865 | */ |
865 | 866 | if( !mw.getScriptLoaderPath() ) { |
866 | 867 | setTimeout( function() { |
867 | | - mw.waitForObject( className, function( className ) { |
868 | | - // Once object is ready run loadDone |
869 | | - mw.loadDone( className ); |
| 868 | + mw.waitForObject( className, function( className ) { |
| 869 | + // Once object is ready and we don't need message keys, run loadDone |
| 870 | + if( !mw.currentClassMissingMessages ){ |
| 871 | + mw.loadDone( className ); |
| 872 | + } |
870 | 873 | } ); |
871 | | - }, 25 ); |
| 874 | + }, 25 ); |
872 | 875 | } |
873 | 876 | }, |
874 | 877 | |