File tree 3 files changed +70
-1
lines changed
3 files changed +70
-1
lines changed Original file line number Diff line number Diff line change @@ -662,7 +662,7 @@ define( [
662
662
url : url ,
663
663
absUrl : absUrl ,
664
664
toPage : url ,
665
- prevPage : options . fromPage ,
665
+ prevPage : options ? options . fromPage : undefined ,
666
666
dataUrl : dataUrl ,
667
667
deferred : deferred ,
668
668
options : settings
Original file line number Diff line number Diff line change
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 Pagecontainer Unit Test Suite</ 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 ="../../../tests/jquery.testHelper.js "> </ script >
13
+
14
+ < link rel ="stylesheet " href ="../../../css/themes/default/jquery.mobile.css "/>
15
+ < link rel ="stylesheet " href ="../../../external/qunit/qunit.css "/>
16
+ < link rel ="stylesheet " href ="../../jqm-tests.css "/>
17
+ < script src ="../../../external/qunit/qunit.js "> </ script >
18
+ < script >
19
+ $ . testHelper . asyncLoad ( [
20
+ [ "init" ] ,
21
+ [
22
+ "pagecontainer_core.js"
23
+ ]
24
+ ] ) ;
25
+ </ script >
26
+
27
+ < script src ="../../swarminject.js "> </ script >
28
+ </ head >
29
+ < body id ="the-body ">
30
+ < div id ="qunit "> </ div >
31
+
32
+ < div data-nstest-role ="page " id ="start-page ">
33
+ < div data-role ="header "> < h1 > Start page</ h1 > </ div >
34
+ < div class ="ui-content ">
35
+ < a href ="other-page.html " id ="go-to-other-page "> Go to other page</ a >
36
+ < a href ="page-does-not-exist.html " id ="go-to-nonexistent-page "> Go to non-existent page</ a >
37
+ </ div >
38
+ </ div >
39
+ </ body >
40
+ </ html >
Original file line number Diff line number Diff line change
1
+ ( function ( ) {
2
+ var originalLoad = $ . mobile . pagecontainer . prototype . _triggerWithDeprecated
3
+ module ( "load method" , {
4
+ setup : function ( ) {
5
+ $ . mobile . pagecontainer . prototype . _triggerWithDeprecated = function ( ) {
6
+ return {
7
+ deprecatedEvent : {
8
+ isDefaultPrevented : function ( ) {
9
+ return true ;
10
+ }
11
+ } ,
12
+ event : {
13
+ isDefaultPrevented : true
14
+ }
15
+ }
16
+ }
17
+ } ,
18
+ teardown : function ( ) {
19
+ $ . mobile . pagecontainer . prototype . _triggerWithDeprecated = originalLoad ;
20
+ }
21
+ } ) ;
22
+ test ( "load does not trigger an error when called withput a second param" , function ( ) {
23
+ var pagecontainer = $ ( ":mobile-pagecontainer" ) ;
24
+
25
+ pagecontainer . pagecontainer ( "load" , "stuff.html" ) ;
26
+ ok ( "no error triggered when load method called without options" ) ;
27
+ } ) ;
28
+
29
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments