( currentDialog is set in the showDialog() function.) This variable would be null when
the document initially loads because of the line var currentDialog = null; earlier in iui.js, which
runs every time the document loads.
The node is then evaluated to determine whether it is a dialog (containing class=???dialog??? as an
attribute) or a normal page. While the opening page of an iPhone/iPod touch is often a normal page,
you may wish to have a login or initial search dialog.
Loading a Standard iUI Page
For normal pages, iUI will assign the value of currentPage to the variable fromPage and then reassign
currentPage to the page parameter. If fromPage is not null (i.e., every page after the initial page), then
iUI performs a slide - in animation with a function called slidePages() . The fromPage , page , and
backwards variables are passed to slidePages() .
Chapter 3: Implementing the Interface
70
However, because this is the first time running this routine (and fromPage will equal null ), the
updatePage() function is called:
function updatePage(page, fromPage)
{
if (!page.id)
page.id = ???__??? + (++newPageCount) + ???__???;
location.href = currentHash = hashPrefix + page.id;
pageHistory.push(page.id);
var pageTitle = $(???pageTitle???);
if (page.
Pages:
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96