diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-02-12 09:25:41 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-02-12 09:25:41 -0500 |
commit | 41a1472469df35005d04e1a2b5e8b756980a4e7e (patch) | |
tree | cb82227614d37f47d2261df4dfc9ec09509bf9a0 | |
parent | 5c7be4798f57dd8cbbad6c39e57a35332feef66a (diff) | |
download | jquery-ui-41a1472469df35005d04e1a2b5e8b756980a4e7e.tar.gz jquery-ui-41a1472469df35005d04e1a2b5e8b756980a4e7e.zip |
Button: Use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;'
-rw-r--r-- | ui/jquery.ui.button.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 1c3cf2c64..25f1668a5 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -66,7 +66,7 @@ $.widget( "ui.button", { this._determineButtonType(); this.hasTitle = !!this.buttonElement.attr( "title" ); - var self = this, + var that = this, options = this.options, toggleButton = this.type === "checkbox" || this.type === "radio", hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), @@ -104,10 +104,10 @@ $.widget( "ui.button", { this.element .bind( "focus.button", function() { // no need to check disabled, focus won't be triggered anyway - self.buttonElement.addClass( focusClass ); + that.buttonElement.addClass( focusClass ); }) .bind( "blur.button", function() { - self.buttonElement.removeClass( focusClass ); + that.buttonElement.removeClass( focusClass ); }); if ( toggleButton ) { @@ -115,7 +115,7 @@ $.widget( "ui.button", { if ( clickDragged ) { return; } - self.refresh(); + that.refresh(); }); // if mouse moves between mousedown and mouseup (drag) set clickDragged flag // prevents issue where button state changes but checkbox/radio checked state @@ -145,7 +145,7 @@ $.widget( "ui.button", { return false; } $( this ).toggleClass( "ui-state-active" ); - self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + that.buttonElement.attr( "aria-pressed", that.element[0].checked ); }); } else if ( this.type === "radio" ) { this.buttonElement.bind( "click.button", function() { @@ -153,9 +153,9 @@ $.widget( "ui.button", { return false; } $( this ).addClass( "ui-state-active" ); - self.buttonElement.attr( "aria-pressed", "true" ); + that.buttonElement.attr( "aria-pressed", "true" ); - var radio = self.element[ 0 ]; + var radio = that.element[ 0 ]; radioGroup( radio ) .not( radio ) .map(function() { @@ -172,7 +172,7 @@ $.widget( "ui.button", { } $( this ).addClass( "ui-state-active" ); lastActive = this; - self.document.one( "mouseup", function() { + that.document.one( "mouseup", function() { lastActive = null; }); }) |