diff --git a/modules/ext.scribunto.js b/modules/ext.scribunto.js index 802f80a0..63839d20 100644 --- a/modules/ext.scribunto.js +++ b/modules/ext.scribunto.js @@ -10,6 +10,12 @@ mw.scribunto = { 'init': function () { var regex = /^mw-scribunto-error-(\d+)/; var that = this; + var dialog = $( '
' ); + dialog.dialog({ + title: mw.msg( 'scribunto-parser-dialog-title' ), + autoOpen: false + }); + $('.scribunto-error').each( function( index, span ) { var matches = regex.exec( span.id ); if ( matches == null ) { @@ -26,12 +32,11 @@ mw.scribunto = { return; } var error = that.errors[ errorId ]; - $( '' ) + dialog + .dialog( 'close' ) .html( error ) - .dialog({ - 'title': mw.msg( 'scribunto-parser-dialog-title' ), - 'position': [ evt.clientX + 5, evt.clientY + 5 ], - }); + .dialog( 'option', 'position', [ evt.clientX + 5, evt.clientY + 5 ] ) + .dialog( 'open' ); } ); } ); }