Skip to content

Commit c1d2ead

Browse files
committed
Checkbox: Update visual test to current jQuery version; update impl to set version and options defaults, and to set aria-checked attribute to correct value.
1 parent b8d15a2 commit c1d2ead

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/visual/checkbox/checkbox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Checkbox Visual Test : Default</title>
66
<link rel="stylesheet" href="../visual.css" type="text/css" />
77
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" />
8-
<script type="text/javascript" src="../../../jquery-1.4.2.js"></script>
8+
<script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
99
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
1010
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
1111
<script type="text/javascript" src="../../../ui/jquery.ui.checkbox.js"></script>

ui/jquery.ui.checkbox.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
var checkboxId = 0;
1919

2020
$.widget( "ui.checkbox", {
21-
21+
version: "@VERSION",
22+
options: {
23+
disabled : null
24+
},
2225
_create: function() {
2326

2427
var that = this;
@@ -101,7 +104,8 @@ $.widget( "ui.checkbox", {
101104
},
102105

103106
_refresh: function() {
104-
this.iconElement.toggleClass( "ui-icon ui-icon-check", this.element.is(":checked") );
107+
var checked = this.element.is(":checked");
108+
this.iconElement.toggleClass( "ui-icon ui-icon-check", checked ).attr( "aria-checked", checked );
105109
},
106110

107111
widget: function() {
@@ -126,14 +130,10 @@ $.widget( "ui.checkbox", {
126130
this.checkboxElement
127131
[ value ? "addClass" : "removeClass" ]( "ui-checkbox-disabled" );
128132
}
129-
133+
130134
$.Widget.prototype._setOption.apply( this, arguments );
131135
},
132136

133137
});
134138

135-
$.extend( $.ui.checkbox, {
136-
version: "@VERSION"
137-
});
138-
139139
}( jQuery ));

0 commit comments

Comments
 (0)