Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -676,10 +676,13 @@ |
677 | 677 | * classSet saves round trips to the server by grabbing things we will likely need in the first request. |
678 | 678 | * @param {callback} function callback to be called once mwEmbed is ready |
679 | 679 | */ |
680 | | -var mwAlreadyRequestedUi = false; |
| 680 | +var mwAlreadyRequestedUi = null; |
681 | 681 | var mwQueuedLoadMwEmbedFunctions = []; |
682 | | -var mwForceUiComponents = '$j.ui,$j.widget,$j.ui.mouse,$j.ui.button,$j.ui.draggable,$j.ui.position,$j.ui.resizable,$j.ui.slider,$j.ui.dialog'; |
683 | 682 | function loadMwEmbed( classSet, callback ) { |
| 683 | + var mwForceUiComponents = '$j.ui,$j.widget,$j.ui.mouse,$j.ui.button,$j.ui.draggable,$j.ui.position,$j.ui.resizable,$j.ui.slider,$j.ui.dialog'; |
| 684 | + if( !mwQueuedLoadMwEmbedFunctions){ |
| 685 | + mwQueuedLoadMwEmbedFunctions = []; |
| 686 | + } |
684 | 687 | if( typeof classSet == 'function') { |
685 | 688 | callback = classSet; |
686 | 689 | } |
— | — | @@ -687,10 +690,11 @@ |
688 | 691 | mw.load( classSet, callback); |
689 | 692 | return ; |
690 | 693 | } |
691 | | - if( mwAlreadyRequestedUi !== false ){ |
| 694 | + if( mwAlreadyRequestedUi ){ |
692 | 695 | mwQueuedLoadMwEmbedFunctions.push(function(){ |
693 | 696 | mw.load( classSet, callback); |
694 | 697 | }); |
| 698 | + return ; |
695 | 699 | } |
696 | 700 | var doLoadMwEmbed = function(){ |
697 | 701 | // Inject mwEmbed |