From 9ac52deaa271d3162e3d24724faf03f0b92ba3df Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 12:02:28 -0400 Subject: Don't use :radio selector. --- ui/jquery.ui.button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index f84d748cf..bd0af9408 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -216,7 +216,7 @@ $.widget( "ui.button", { if ( this.element.is(":checkbox") ) { this.type = "checkbox"; - } else if ( this.element.is(":radio") ) { + } else if ( this.element.is("[type=radio]") ) { this.type = "radio"; } else if ( this.element.is("input") ) { this.type = "input"; @@ -358,7 +358,7 @@ $.ui.button.version = "@VERSION"; $.widget( "ui.buttonset", { options: { - items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" + items: ":button, :submit, :reset, :checkbox, [type=radio], a, :data(button)" }, _create: function() { -- cgit v1.2.3 From e6f21410ff4e2e88ed5f44c872451e8030898178 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 12:47:15 -0400 Subject: Don't use :checkbox selector. --- tests/unit/button/button_tickets.js | 10 +++++----- ui/jquery.ui.button.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/tests/unit/button/button_tickets.js b/tests/unit/button/button_tickets.js index 43bfdb833..fe0d82fd6 100644 --- a/tests/unit/button/button_tickets.js +++ b/tests/unit/button/button_tickets.js @@ -30,23 +30,23 @@ test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard test( "#7092 - button creation that requires a matching label does not find label in all cases", function() { var group = $( "" ); - group.find( "input:checkbox" ).button(); + group.find( "input[type=checkbox]" ).button(); ok( group.find( "label" ).is( ".ui-button" ) ); group = $( "" ); - group.filter( "input:checkbox" ).button(); + group.filter( "input[type=checkbox]" ).button(); ok( group.filter( "label" ).is( ".ui-button" ) ); group = $( "" ); - group.find( "input:checkbox" ).button(); + group.find( "input[type=checkbox]" ).button(); ok( group.filter( "label" ).is( ".ui-button" ) ); group = $( "" ); - group.find( "input:checkbox" ).button(); + group.find( "input[type=checkbox]" ).button(); ok( group.find( "label" ).is( ".ui-button" ) ); group = $( "" ); - group.filter( "input:checkbox" ).button(); + group.filter( "input[type=checkbox]" ).button(); ok( group.find( "label" ).is( ".ui-button" ) ); }); diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index bd0af9408..44dbc68db 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -214,7 +214,7 @@ $.widget( "ui.button", { _determineButtonType: function() { var ancestor, labelSelector, checked; - if ( this.element.is(":checkbox") ) { + if ( this.element.is("[type=checkbox]") ) { this.type = "checkbox"; } else if ( this.element.is("[type=radio]") ) { this.type = "radio"; @@ -358,7 +358,7 @@ $.ui.button.version = "@VERSION"; $.widget( "ui.buttonset", { options: { - items: ":button, :submit, :reset, :checkbox, [type=radio], a, :data(button)" + items: ":button, :submit, :reset, [type=checkbox], [type=radio], a, :data(button)" }, _create: function() { -- cgit v1.2.3 From 26b5492441346aff7b609acc61b56c593b7662d2 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 13:51:49 -0400 Subject: Button: Fixed version properties. --- ui/jquery.ui.button.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 44dbc68db..e2fefb10b 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -354,9 +354,8 @@ $.widget( "ui.button", { } }); -$.ui.button.version = "@VERSION"; - $.widget( "ui.buttonset", { + version: "@VERSION", options: { items: ":button, :submit, :reset, [type=checkbox], [type=radio], a, :data(button)" }, -- cgit v1.2.3 From b4ca9289cf018c744ec57e8356783a76ff3691e0 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 14:42:08 -0400 Subject: Don't use :button selector. --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index e2fefb10b..6be6d3fe9 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -357,7 +357,7 @@ $.widget( "ui.button", { $.widget( "ui.buttonset", { version: "@VERSION", options: { - items: ":button, :submit, :reset, [type=checkbox], [type=radio], a, :data(button)" + items: "button, [type=button], :submit, :reset, [type=checkbox], [type=radio], a, :data(button)" }, _create: function() { -- cgit v1.2.3 From 8b17f68b579f2b12a6801be741434a53ffe28bbf Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 14:50:49 -0400 Subject: Don't use :reset selector. --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 6be6d3fe9..f3abdaf76 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -357,7 +357,7 @@ $.widget( "ui.button", { $.widget( "ui.buttonset", { version: "@VERSION", options: { - items: "button, [type=button], :submit, :reset, [type=checkbox], [type=radio], a, :data(button)" + items: "button, [type=button], :submit, [type=reset], [type=checkbox], [type=radio], a, :data(button)" }, _create: function() { -- cgit v1.2.3 From e37f599a53d57a1fdee2fd8de01198d68aa86ae8 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 14:53:27 -0400 Subject: Don't use :submit selector. --- demos/button/default.html | 4 ++-- ui/jquery.ui.button.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ui/jquery.ui.button.js') diff --git a/demos/button/default.html b/demos/button/default.html index 60d2674c0..90369f816 100644 --- a/demos/button/default.html +++ b/demos/button/default.html @@ -11,7 +11,7 @@ @@ -22,7 +22,7 @@ - + An anchor diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index f3abdaf76..0feb1e893 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -357,7 +357,7 @@ $.widget( "ui.button", { $.widget( "ui.buttonset", { version: "@VERSION", options: { - items: "button, [type=button], :submit, [type=reset], [type=checkbox], [type=radio], a, :data(button)" + items: "button, [type=button], [type=submit], [type=reset], [type=checkbox], [type=radio], a, :data(button)" }, _create: function() { -- cgit v1.2.3 From 15ece1f51a0fcbe718ad2836b078bdef72301de8 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 May 2012 14:56:18 -0400 Subject: Buttonset: Use input[type=*] instead of just [type=*]. --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/jquery.ui.button.js') diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 0feb1e893..772ad4d6f 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -357,7 +357,7 @@ $.widget( "ui.button", { $.widget( "ui.buttonset", { version: "@VERSION", options: { - items: "button, [type=button], [type=submit], [type=reset], [type=checkbox], [type=radio], a, :data(button)" + items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)" }, _create: function() { -- cgit v1.2.3 From 1f1613852cb6116cd71a6600d737099fc2d55d2a Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Mon, 21 May 2012 21:52:48 -0400 Subject: Button: Corrected default label applied to submit buttons. Fixed #8337: Submit inputs don't automatically set label option. --- tests/unit/button/button_options.js | 4 ++++ ui/jquery.ui.button.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ui/jquery.ui.button.js') diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index 9ef4a19db..3dd361ac9 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -53,6 +53,7 @@ test("text false with icon", function() { test("label, default", function() { $("#button").button(); deepEqual( $("#button").text(), "Label" ); + deepEqual( $( "#button").button( "option", "label" ), "Label" ); $("#button").button("destroy"); }); @@ -62,12 +63,14 @@ test("label", function() { label: "xxx" }); deepEqual( $("#button").text(), "xxx" ); + deepEqual( $("#button").button( "option", "label" ), "xxx" ); $("#button").button("destroy"); }); test("label default with input type submit", function() { deepEqual( $("#submit").button().val(), "Label" ); + deepEqual( $("#submit").button( "option", "label" ), "Label" ); }); test("label with input type submit", function() { @@ -75,6 +78,7 @@ test("label with input type submit", function() { label: "xxx" }).val(); deepEqual( label, "xxx" ); + deepEqual( $("#submit").button( "option", "label" ), "xxx" ); }); test("icons", function() { diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 772ad4d6f..810191775 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -73,7 +73,7 @@ $.widget( "ui.button", { focusClass = "ui-state-focus"; if ( options.label === null ) { - options.label = this.buttonElement.html(); + options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html()); } this.buttonElement -- cgit v1.2.3