Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Checkbox: Update visual test to current jQuery version; update impl t…

…o set version and options defaults, and to set aria-checked attribute to correct value.
  • Loading branch information...
commit c1d2eadcd901da07d84f0d3a72996099c4676fe6 1 parent b8d15a2
Jörn Zaefferer jzaefferer authored
2  tests/visual/checkbox/checkbox.html
@@ -5,7 +5,7 @@
5 5 <title>Checkbox Visual Test : Default</title>
6 6 <link rel="stylesheet" href="../visual.css" type="text/css" />
7 7 <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>
9 9 <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
10 10 <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
11 11 <script type="text/javascript" src="../../../ui/jquery.ui.checkbox.js"></script>
14 ui/jquery.ui.checkbox.js
@@ -18,7 +18,10 @@
18 18 var checkboxId = 0;
19 19
20 20 $.widget( "ui.checkbox", {
21   -
  21 + version: "@VERSION",
  22 + options: {
  23 + disabled : null
  24 + },
22 25 _create: function() {
23 26
24 27 var that = this;
@@ -101,7 +104,8 @@ $.widget( "ui.checkbox", {
101 104 },
102 105
103 106 _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 );
105 109 },
106 110
107 111 widget: function() {
@@ -126,14 +130,10 @@ $.widget( "ui.checkbox", {
126 130 this.checkboxElement
127 131 [ value ? "addClass" : "removeClass" ]( "ui-checkbox-disabled" );
128 132 }
129   -
  133 +
130 134 $.Widget.prototype._setOption.apply( this, arguments );
131 135 },
132 136
133 137 });
134 138
135   -$.extend( $.ui.checkbox, {
136   - version: "@VERSION"
137   -});
138   -
139 139 }( jQuery ));

0 comments on commit c1d2ead

Please sign in to comment.
Something went wrong with that request. Please try again.