Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Panel: Ensure height is removed from modal inline style upon panel close
Browse files Browse the repository at this point in the history
(cherry picked from commit 3293d59)

Tests 0625b4b
  • Loading branch information
Gabriel Schulhof committed Apr 11, 2014
1 parent 0625b4b commit 003fed6
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration/panel/open-click-bubbling-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"widgets/panel",
"widgets/page"
],
[ "init" ],
[ "jquery.mobile.init" ],
[
"open_click_bubbling_core.js"
]
Expand Down
43 changes: 43 additions & 0 deletions tests/integration/panel/panel-stale-height-tests.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Panel Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../../js/requirejs.config.js"></script>
<script src="../../../js/jquery.tag.inserter.js"></script>
<script src="../../jquery.setNameSpace.js"></script>
<script src="../../../tests/jquery.testHelper.js"></script>

<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css"/>
<link rel="stylesheet" href="../../../external/qunit/qunit.css"/>
<link rel="stylesheet" href="../../jqm-tests.css"/>
<script src="../../../external/qunit/qunit.js"></script>
<script>
$.testHelper.asyncLoad([
[
"widgets/panel",
"widgets/page"
],
[ "jquery.mobile.init" ],
[
"panel_stale_height_core.js"
]
]);
</script>

<script src="../../swarminject.js"></script>
</head>
<body class="ui-body-b">
<div id="qunit"></div>

<div data-nstest-role="page">
<div data-nstest-role="panel" id="stale-height-panel">
<p>The panel</p>
</div>
<a href="#stale-height-panel" id="stale-height-panel-link">Open panel</a>
</div>

</body>
26 changes: 26 additions & 0 deletions tests/integration/panel/panel_stale_height_core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
asyncTest( "Closing a panel removes the modal's height from its inline CSS", function() {
var eventNs = ".closingAPanelRemovesModalsHeightFromItsInlineCSS",
panel = $( "#stale-height-panel" ),
link = $( "#stale-height-panel-link" ),
modal = $( ".ui-panel-dismiss" );

$.testHelper.detailedEventCascade([
function() {
link.click();
},
{
panelopen: { src: panel, event: "panelopen" + eventNs + "1" }
},
function() {
panel.panel( "close" );
},
{
panelclose: { src: panel, event: "panelclose" + eventNs + "2" }
},
function() {
deepEqual( ( modal.attr( "style" ) || "" ).match( /height:\s*[0-9]/ ), null,
"style attribute does not include a height field" );
start();
}
]);
});

0 comments on commit 003fed6

Please sign in to comment.