https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113713

Revision: 113713
Author:   santhosh
Date:     2012-03-13 09:05:09 +0000 (Tue, 13 Mar 2012)
Log Message:
-----------
Make the widget more suitable for reuse, renamed to multiselectautocomplete

Modified Paths:
--------------
    
trunk/extensions/Translate/resources/ext.translate.special.pagetranslation.js

Modified: 
trunk/extensions/Translate/resources/ext.translate.special.pagetranslation.js
===================================================================
--- 
trunk/extensions/Translate/resources/ext.translate.special.pagetranslation.js   
    2012-03-13 08:42:49 UTC (rev 113712)
+++ 
trunk/extensions/Translate/resources/ext.translate.special.pagetranslation.js   
    2012-03-13 09:05:09 UTC (rev 113713)
@@ -9,17 +9,20 @@
 jQuery( function( $ ) {
        "use strict"
        
-       $.widget( "ui.combobox", {
+       $.widget( "ui.multiselectautocomplete", {
+               options: { 
+                       inputbox: null, // a jquery selector for the input box 
where selections are written.
+                       // @TODO can have more options.
+               },
                _create: function() {
                        var self = this,
                                select = this.element.hide(),
-                               selected = select.children( ":selected" );
-                               
+                               options = this.options;
                        function split( val ) {
                                return val.split( /,\s*/ );
                        }
                        
-                       var input = this.input = $( '#tpt-prioritylangs' )
+                       var input = this.input = $( options.inputbox )
                                .autocomplete( {
                                        delay: 0,
                                        minLength: 0,
@@ -76,5 +79,5 @@
                        }
                } );
 
-       $( "#wpUserLanguage" ).combobox();
+       $( "#wpUserLanguage" ).multiselectautocomplete( { inputbox : 
'#tpt-prioritylangs' } );
 } );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to