Skip to content
Permalink
Browse files

Button: Corrected default label applied to submit buttons. Fixed #833…

…7: Submit inputs don't automatically set label option.
  • Loading branch information
tjvantoll authored and scottgonzalez committed May 22, 2012
1 parent 286941e commit 1f1613852cb6116cd71a6600d737099fc2d55d2a
Showing with 5 additions and 1 deletion.
  1. +4 −0 tests/unit/button/button_options.js
  2. +1 −1 ui/jquery.ui.button.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,19 +63,22 @@ 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() {
var label = $("#submit").button({
label: "xxx"
}).val();
deepEqual( label, "xxx" );
deepEqual( $("#submit").button( "option", "label" ), "xxx" );
});

test("icons", function() {
@@ -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

0 comments on commit 1f16138

Please sign in to comment.
You can’t perform that action at this time.