r2706 - removed "that" references. Using "self" throughout

r2706 - removed "that" references. Using "self" throughout


Author: scottjehl
Date: Thu Jun 11 12:05:51 2009
New Revision: 2706
Modified:
branches/labs/selectmenu/ui.selectmenu.js
Log:
removed "that" references. Using "self" throughout
Modified: branches/labs/selectmenu/ui.selectmenu.js
==============================================================================
--- branches/labs/selectmenu/ui.selectmenu.js    (original)
+++ branches/labs/selectmenu/ui.selectmenu.js    Thu Jun 11 12:05:51 2009
@@ -41,15 +41,15 @@
        //make associated form label trigger focus
        $('label[for='+this.element.attr('id')+']')
            .click(function(){
-                that.newelement.focus();
+                self.newelement.focus();
                return false;
            });    
        //click toggle for menu visibility
        this.newelement
        .bind('click', function(){
-            that._closeOthers();
-            that._toggle();
+            self._closeOthers();
+            self._toggle();
            return false;
        })
        .keydown(function(event){
@@ -58,18 +58,18 @@
                case $.ui.keyCode.ENTER:
                case $.ui.keyCode.SPACE:
                    ret = false;
-                    that._closeOthers();
-                    that._toggle();    
+                    self._closeOthers();
+                    self._toggle();    
                    break;
                case $.ui.keyCode.UP:
                case $.ui.keyCode.LEFT:
                    //trigger click event on previous (should be abstracted out)
-                    
that.list.find('li.ui-selectmenu-item-selected').prev().trigger('mouseup');    
+                    
self.list.find('li.ui-selectmenu-item-selected').prev().trigger('mouseup');    
                    break;
                case $.ui.keyCode.DOWN:
                case $.ui.keyCode.RIGHT:
                    //trigger click event on next (should be abstracted out)
-                    
that.list.find('li.ui-selectmenu-item-selected').next().trigger('mouseup');    
+                    
self.list.find('li.ui-selectmenu-item-selected').next().trigger('mouseup');    
                    break;    
            }
            return ret;
@@ -81,7 +81,7 @@
        
        //document click closes menu
        $(document).click(function(){
-            that.close();
+            self.close();
        });
        //change event on original selectmenu
@@ -96,14 +96,14 @@
        
        //get selectmenu element option data    
        var s_options = this._selectOptions();
-        var activeClass = (that.options.style == "popup") ? "
ui-state-active" : "";
+        var activeClass = (self.options.style == "popup") ? "
ui-state-active" : "";
        //write li's
        for(var i in s_options){
            var thisLi = $('<li><a href="#" tabindex="-1" role="option"
aria-selected="false">'+ s_options[i].text +'</a></li>')
                .data('index',i)
                .addClass(s_options[i].classes)
                .mouseup(function(){
-                    that.value($(this).data('index'));
+                    self.value($(this).data('index'));
                })
                .bind('mouseover focus', function(){
                    
$(this).parent().find('.ui-selectmenu-item-selected').addClass(activeClass);
@@ -136,7 +136,7 @@
        //transfer menu click to menu button
        this.list
        .click(function(){
-            that.newelement.trigger('click');    // (should be abstracted out)
+            self.newelement.trigger('click');    // (should be abstracted out)
            return false;
        })
        .keydown(function(event){
@@ -160,12 +160,12 @@
                case $.ui.keyCode.ENTER:
                case $.ui.keyCode.SPACE:
                    ret = false;
-                    that.close();
+                    self.close();
                    $(event.target).parents('li:eq(0)').trigger('mouseup');
                    break;        
                case $.ui.keyCode.TAB:
                    ret = true;
-                    that.close();
+                    self.close();
                    break;    
            }
            return ret;
@@ -259,12 +259,12 @@
    
    _selectOptions: function(){
        var opts = [];
-        var that = this;
+        var self = this;
        this.element.find('option').each(function(i){
            opts.push({
                value: jQuery(this).attr('value'),
-                text: that._formatText(jQuery(this).text()),
-                selected: (i == that._selectedIndex()),
+                text: self._formatText(jQuery(this).text()),
+                selected: (i == self._selectedIndex()),
                classes: jQuery(this).attr('class')
            });
        });
@@ -358,7 +358,7 @@
        style: 'popup', //also avail: 'dropdown'
        width: null, //defaults to select width
        menuWidth: null, //sets menu body separately. number value or 'widest'
-        handleWidth: 26, //width that the icon arrow block will hang off the
edge in a 'popup' style menu
+        handleWidth: 26, //width self the icon arrow block will hang off the
edge in a 'popup' style menu
        format: null //array of objects with find and rep properties. Each will
run in order and perform find/replace formatting.
                    //for example: format: [{find:/^([a-zA-Z0-9 ]+)\-/g, rep: '<span
class="header">$1</span>'}
    }