r101424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101423‎ | r101424 | r101425 >
Date:22:40, 31 October 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
init of wikieditor just before needed
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SF_wikieditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SF_wikieditor.js
@@ -1,8 +1,3 @@
2 -// setup wikieditor functionality
3 -jQuery(function(){
4 - ext.wikieditor.setup();
5 -});
6 -
72 // create ext if it does not exist yet
83 if ( typeof( window[ 'ext' ] ) == "undefined" ) {
94 window[ 'ext' ] = {};
@@ -11,6 +6,7 @@
127 window.ext.wikieditor = new function(){
138
149 var config;
 10+ var isSetUp = false;
1511
1612 // common setup for all editor instances
1713 function setup () {
@@ -20,6 +16,12 @@
2117
2218 // initialize the wikieditor on the specified element
2319 function init ( input_id, params ) {
 20+
 21+ if ( !isSetUp ) {
 22+ isSetUp = true;
 23+ setup();
 24+ }
 25+
2426 var input = jQuery( '#' + input_id );
2527 input.wikiEditor( 'addModule', config );
2628 }