Skip to content

Commit 0802765

Browse files
committed
Checkboxradio: PR Fixup
1 parent f8b5a61 commit 0802765

File tree

6 files changed

+38
-54
lines changed

6 files changed

+38
-54
lines changed

demos/checkboxradio/product-selector.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
$( "input" ).filter( ":checked" ).not( this ).trigger( "change" );
3131
});
3232
$( "input" ).filter( ":checked" ).trigger( "change" );
33-
$( ".shape-bar" ).controlgroup();
33+
$( ".shape-bar, .brand" ).controlgroup();
3434
$( ".toggles" ).controlgroup({
3535
direction: "vertical"
3636
});
3737
});
3838
</script>
3939
<style>
4040
.shape {
41-
margin: 1em;
41+
margin-left: 4.5em;
42+
margin-top: 2.5em;
4243
height: 8em;
4344
width: 8em;
4445
box-shadow: 4px 4px 8px;
4546
color: #ccc;
46-
margin-top: 1.5em;
4747
background-repeat: no-repeat;
4848
background-size: 90%;
4949
background-position: 50%;
@@ -54,6 +54,9 @@
5454
.pill, .rectangle {
5555
width: 16em;
5656
}
57+
.square, .circle {
58+
margin-left: 9em;
59+
}
5760
.border {
5861
border: 2px solid #333333;
5962
}
@@ -64,9 +67,6 @@
6467
display: inline-block;
6568
vertical-align: top;
6669
}
67-
.shape-wrap {
68-
margin-bottom: 2em;
69-
}
7070
.controls {
7171
background: #ccc;
7272
padding: 1em;
@@ -77,7 +77,7 @@
7777
<body>
7878
<div class="controls">
7979
<div class="brand-wrap">
80-
<h2>1.) Select a brand</h2>
80+
<h3>1.) Select a brand</h3>
8181
<div class="brand">
8282
<label for="brand-jquery">jQuery</label>
8383
<input data-background-color="#0769AD" data-color="#7ACEF4" data-background-image="url(images/jquery.png)" type="radio" name="brand" id="brand-jquery">
@@ -92,7 +92,7 @@ <h2>1.) Select a brand</h2>
9292
</div>
9393
</div>
9494
<div class="shape-wrap">
95-
<h2>2.) Select a shape</h2>
95+
<h3>2.) Select a shape</h3>
9696
<div class="shape-bar">
9797
<label for="shape-circle">Circle</label>
9898
<input type="radio" name="shape" id="shape-circle" value="circle" checked>
@@ -105,7 +105,7 @@ <h2>2.) Select a shape</h2>
105105
</div>
106106
</div>
107107
<div class="toggle-wrap">
108-
<h2>3.) customize</h2>
108+
<h3>3.) Customize</h3>
109109
<div class="toggles">
110110
<label for="color">Shadow</label>
111111
<input class="toggle brand-toggle" type="checkbox" name="color" id="color">
@@ -121,7 +121,7 @@ <h2>3.) customize</h2>
121121
</div>
122122

123123
<div class="demo-description">
124-
<p>Using two sets of radio buttons and one group of checkboxes to implement a product selector.</p>
124+
<p>Using two sets of radio buttons, as horizontal controlgroups, and one group of checkboxes, as a vertical controlgroup, to implement a product selector.</p>
125125
</div>
126126
</body>
127127
</html>

tests/unit/checkboxradio/checkboxradio.html

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,8 @@
44
<meta charset="utf-8">
55
<title>jQuery UI Checkboxradio Test Suite</title>
66

7-
<script src="../../jquery.js"></script>
8-
<link rel="stylesheet" href="../../../external/qunit/qunit.css">
9-
<script src="../../../external/qunit/qunit.js"></script>
10-
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
11-
<script src="../testsuite.js"></script>
12-
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
13-
<script>
14-
TestHelpers.loadResources({
15-
css: [ "core", "button", "checkboxradio" ],
16-
js: [
17-
"ui/core.js",
18-
"ui/widget.js",
19-
"ui/checkboxradio.js"
20-
]
21-
});
22-
</script>
23-
24-
<script src="checkboxradio_common.js"></script>
25-
<script src="checkboxradio_core.js"></script>
26-
<script src="checkboxradio_methods.js"></script>
27-
<script src="checkboxradio_options.js"></script>
28-
<script src="../swarminject.js"></script>
7+
<script src="../../lib/css.js" data-modules="core button checkboxradio"></script>
8+
<script src="../../lib/bootstrap.js" data-modules="common core methods options"></script>
299
</head>
3010
<body>
3111

tests/unit/checkboxradio/checkboxradio_common.js renamed to tests/unit/checkboxradio/common.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
TestHelpers.commonWidgetTests( "checkboxradio", {
1+
define( [
2+
"lib/common",
3+
"ui/checkboxradio"
4+
], function( common ) {
5+
6+
common.testWidget( "checkboxradio", {
27
noDefaultElement: true,
38
defaults: {
49
disabled: null,
@@ -13,3 +18,5 @@ TestHelpers.commonWidgetTests( "checkboxradio", {
1318
create: null
1419
}
1520
});
21+
22+
} );

tests/unit/checkboxradio/checkboxradio_core.js renamed to tests/unit/checkboxradio/core.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/*
2-
* checkboxradio_core.js
3-
*/
4-
5-
6-
(function($) {
1+
define( [
2+
"jquery",
3+
"ui/checkboxradio"
4+
], function( $ ) {
75

86
module( "Checkboxradio: core" );
97
test( "Checkbox - Initial class structure", function( assert ) {
@@ -178,4 +176,5 @@ test( "Calling checkboxradio on an input with no label throws an error", functio
178176
"Proper error thrown"
179177
);
180178
});
181-
})(jQuery);
179+
180+
} );

tests/unit/checkboxradio/checkboxradio_methods.js renamed to tests/unit/checkboxradio/methods.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
/*
2-
* checkboxradio_methods.js
3-
*/
1+
define( [
2+
"jquery",
3+
"ui/checkboxradio"
4+
], function( $ ) {
45

5-
6-
(function($) {
76
module( "Checkboxradio: methods" );
87

98
$.each( [ "checkbox", "radio" ], function( index, value ) {
@@ -49,9 +48,9 @@ $.each( [ "checkbox", "radio" ], function( index, value ) {
4948
assert.lacksClasses( widget, "ui-checkboxradio-checked" );
5049
});
5150

52-
test( value + ": destroy", function(){
51+
test( value + ": destroy", function( assert ){
5352
expect( 1 );
54-
domEqual( "#" + value + "-method-destroy", function() {
53+
assert.domEqual( "#" + value + "-method-destroy", function() {
5554
$( "#" + value + "-method-destroy" ).checkboxradio().checkboxradio( "destroy" );
5655
});
5756
});
@@ -95,4 +94,4 @@ test( "Input wrapped in a label preserved on refresh", function() {
9594
strictEqual( input.parent()[ 0 ], element[ 0 ], "Input preserved" );
9695
});
9796

98-
})(jQuery);
97+
} );

tests/unit/checkboxradio/checkboxradio_options.js renamed to tests/unit/checkboxradio/options.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
/*
2-
* checkboxradio_methods.js
3-
*/
4-
5-
(function($) {
1+
define( [
2+
"jquery",
3+
"ui/checkboxradio"
4+
], function( $ ) {
65

76
module( "Checkboxradio: options" );
87

@@ -199,4 +198,4 @@ test( "label", function() {
199198

200199
});
201200

202-
})(jQuery);
201+
} );

0 commit comments

Comments
 (0)