onSelect callback option for ULS

* Correct the dependencies for ext.uls.core, it need not depend on
mediawiki.Uri.
* Move the setlang function out of ULS core js.
* Add a callback function to the example.

Change-Id: Ie3598236b2a884580092194c57558ec109d20803
This commit is contained in:
Santhosh Thottingal
2012-07-23 17:42:00 +05:30
parent b1b7c2feb3
commit 964f508533
4 changed files with 33 additions and 20 deletions

View File

@@ -19,6 +19,14 @@
( function( $ ) {
$( document ).ready( function() {
$( '.uls-trigger' ).uls();
$( '.uls-trigger' ).uls( {
onSelect : function( language ) {
var uri = new mw.Uri( window.location.href );
uri.extend( {
setlang : language
} );
window.location.href = uri.toString();
}
} );
} );
} )( jQuery );