Skip to content

Commit f55d4ce

Browse files
committed
Button: updates to demos based on pr review
1 parent 995a855 commit f55d4ce

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

demos/button/checkbox.html

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,27 @@
1212
<link rel="stylesheet" href="../demos.css">
1313
<script>
1414
$(function() {
15-
$( "form input" ).checkboxradio();
15+
var checkboxes = $( "form input" ).checkboxradio();
1616

17-
$(".controls input, .controls select").on( "change", function(){
17+
$( ".controls input, .controls select" ).on( "change keyup", function(){
1818
var option = $( this ).attr( "name" ),
1919
value = $( this ).val();
2020

21-
if( $( this ).attr( "type" ) === "checkbox" ) {
21+
if( $( this ).is( "[type=checkbox] ") ) {
2222
if( $( this ).is(":checked") ) {
2323
value = true;
2424
} else {
2525
value = false;
2626
}
2727
}
28-
$( "form input" ).checkboxradio( "option", option, value );
28+
checkboxes.checkboxradio( "option", option, value );
2929
});
3030
$( "#create" ).click( function(){
31-
$( "form input" ).checkboxradio();
32-
});
33-
$( "#destroy" ).click( function(){
34-
$( "form input" ).checkboxradio( "destroy" );
35-
});
36-
$( "#enable" ).click( function(){
37-
$( "form input" ).checkboxradio( "enable");
38-
});
39-
$( "#disable" ).click( function(){
40-
$( "form input" ).checkboxradio( "disable" );
41-
});
42-
$( "#refresh" ).click( function(){
43-
$( "form input" ).checkboxradio( "refresh" );
31+
if( this.id !== "create" ){
32+
checkboxes.checkboxradio( this.id );
33+
} else {
34+
checkboxes.checkboxradio();
35+
}
4436
});
4537
});
4638
</script>

demos/button/icons.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
<h1>Widget</h2>
3838
<button>Button with icon only</button>
3939
<button>Button with icon on the left</button>
40-
<button>Button with two icons</button>
41-
<button>Button with two icons and no text</button>
40+
<button>Button with icon</button>
41+
<button>Button with icon and text</button>
4242
</div>
4343
<div class="css">
4444
<h1>CSS</h2>
4545
<button class="ui-button ui-widget ui-corner-all ui-button-icon-only">
4646
<span class="ui-icon ui-icon-gear"></span>
4747
Button with icon only
4848
</button>
49-
<button class="ui-button ui-widget ui-corner-all ui-icon-begining">
49+
<button class="ui-button ui-widget ui-corner-all ui-icon-beginning">
5050
<span class="ui-icon ui-icon-triangle-1-w"></span>
5151
Button with icon on the left
5252
</button>

ui/button.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $.widget( "ui.button", {
4343
showLabel: true,
4444
label: null,
4545
icon: null,
46-
iconPosition: "begining"
46+
iconPosition: "beginning"
4747
},
4848

4949
_getCreateOptions: function() {
@@ -158,7 +158,6 @@ $.widget( "ui.button", {
158158
if ( this.element.is( "input" ) ) {
159159
this.element.val( value );
160160
} else {
161-
console.log( this.icon );
162161
this.element.html( ( ( !!this.icon ) ? "" : this.icon ) + value );
163162
}
164163
}

0 commit comments

Comments
 (0)