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 | | - |
7 | 2 | // create ext if it does not exist yet |
8 | 3 | if ( typeof( window[ 'ext' ] ) == "undefined" ) { |
9 | 4 | window[ 'ext' ] = {}; |
— | — | @@ -11,6 +6,7 @@ |
12 | 7 | window.ext.wikieditor = new function(){ |
13 | 8 | |
14 | 9 | var config; |
| 10 | + var isSetUp = false; |
15 | 11 | |
16 | 12 | // common setup for all editor instances |
17 | 13 | function setup () { |
— | — | @@ -20,6 +16,12 @@ |
21 | 17 | |
22 | 18 | // initialize the wikieditor on the specified element |
23 | 19 | function init ( input_id, params ) { |
| 20 | + |
| 21 | + if ( !isSetUp ) { |
| 22 | + isSetUp = true; |
| 23 | + setup(); |
| 24 | + } |
| 25 | + |
24 | 26 | var input = jQuery( '#' + input_id ); |
25 | 27 | input.wikiEditor( 'addModule', config ); |
26 | 28 | } |