Skip to content

Commit 30c669a

Browse files
author
Gabriel Schulhof
committed
Filterable backcompat: Correctly spell name of option "hideDividers"
Fixes jquery-archive#6702
1 parent 246c455 commit 30c669a

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed

js/widgets/filterable.backcompat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ $.widget( "mobile.filterable", $.mobile.filterable, {
7474
if ( !!this._widget ) {
7575
this._syncTextInputOptions( this._widget.options );
7676
if ( this._widget.widgetName === "listview" ) {
77-
this._widget.options.hidedividers = true;
77+
this._widget.options.hideDividers = true;
7878
this._widget.element.listview( "refresh" );
7979
}
8080
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* mobile filter unit tests - listview
3+
*/
4+
5+
( function( $ ){
6+
7+
module( "Backwards compatibility tests" );
8+
9+
test( "Listview with filter has hideDividers option set to true", function() {
10+
deepEqual( $( "#hidedividers-option-test" ).listview( "option", "hideDividers" ), true );
11+
});
12+
13+
})( jQuery );

tests/unit/filterable/index.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>jQuery Mobile Filter Integration Test</title>
7+
8+
<script src="../../../external/requirejs/require.js"></script>
9+
<script src="../../../js/requirejs.config.js"></script>
10+
<script src="../../../js/jquery.tag.inserter.js"></script>
11+
<script src="../../jquery.setNameSpace.js"></script>
12+
<script src="../../jquery.testHelper.js"></script>
13+
<script src="../../../external/qunit.js"></script>
14+
<script>
15+
$.testHelper.asyncLoad([
16+
[ "widgets/page" ],
17+
[
18+
"jquery.mobile.navigation",
19+
"widgets/listview",
20+
"widgets/filterable",
21+
"widgets/filterable.backcompat",
22+
"widgets/listview.autodividers",
23+
"widgets/toolbar",
24+
"widgets/collapsible",
25+
"widgets/forms/button",
26+
"widgets/controlgroup",
27+
"widgets/forms/select",
28+
"widgets/forms/textinput",
29+
"jquery.mobile.buttonMarkup",
30+
"widgets/forms/checkboxradio"
31+
],
32+
[ "jquery.mobile.init" ],
33+
[ "filterable_core.js" ]
34+
]);
35+
</script>
36+
37+
<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css" />
38+
<link rel="stylesheet" href="../../../external/qunit.css"/>
39+
40+
<script src="../../swarminject.js"></script>
41+
42+
</head>
43+
<body>
44+
45+
<h1 id="qunit-header">jQuery Mobile Filter Integration Test</h1>
46+
<h2 id="qunit-banner"></h2>
47+
<h2 id="qunit-userAgent"></h2>
48+
<ol id="qunit-tests">
49+
</ol>
50+
51+
<div data-nstest-role="page">
52+
<div class="ui-content">
53+
<div id="hidedividers-option-test" data-nstest-role="listview" data-nstest-filter="true">
54+
</div>
55+
</div>
56+
</div>
57+
58+
</body>
59+
</html>

0 commit comments

Comments
 (0)