Skip to content

Commit 4e63fb8

Browse files
committed
Moved the installation of the handler into a require callback to make sure that jquery.mobile is loaded so $.event.special.orientationchange & $.support.orientation are available
1 parent 2bddfeb commit 4e63fb8

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

tests/functional/orientation.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE HTML>
2-
<html>
2+
<html class="ui-mobile-rendering">
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -15,20 +15,22 @@
1515
}
1616

1717
</style>
18-
<script data-main="../../js/jquery.mobile" src="../../external/requirejs/require.js"></script>
18+
<script src="../../external/requirejs/require.js"></script>
1919
<script src="../../js/jquery.tag.inserter.js"></script>
2020
<script>
21+
require( {
22+
baseUrl: "../../js"
23+
} )( [ "jquery", "jquery.mobile" ], function( $ ) {
24+
$( document ).one( "pageinit", function() {
25+
function updateOrientation()
26+
{
27+
$( "#orientationText" ).text( $.event.special.orientationchange.orientation() );
28+
}
2129

22-
$( document ).one( "pageinit", function() {
23-
function updateOrientation()
24-
{
25-
$( "#orientationText" ).text( $.event.special.orientationchange.orientation() );
26-
}
27-
28-
updateOrientation();
29-
$( window ).bind( $.support.orientation ? "orientationchange" : "resize", updateOrientation);
30+
updateOrientation();
31+
$( window ).bind( $.support.orientation ? "orientationchange" : "resize", updateOrientation);
32+
});
3033
});
31-
3234
</script>
3335
</head>
3436

0 commit comments

Comments
 (0)