API Docs for: 0.1

Class UbuntuUI.Pagestack

Class defined in: pagestacks.js:23

The Pagestack manages all Pages in a stack data structure. Initially, the Pagestack contains no Pages. The push() method is normally executed on load to display the app starting page.


The topmost Page on the Pagestack is always displayed.

The Pagestack is declared as a direct child of the content div.

Default application wide footer

The Pagestack contains a default footer (represented in JavaScript as a Toolbar), even if you do not declare one in HTML. The footer has a single Back button.

Customized application wide footer

This application-wide footer can be customized (for example, you can add Buttons) by declaring a footer as a direct child of the pagestack div (see example).

Page specific footers

A page may declare a page-specific footer as a child element.

UbuntuUI.Pagestack( )
<div data-role="page">
   <header data-role="header">
   <div data-role="content">
     <div data-role="pagestack">
       <div data-role="page" id="main">
       <div data-role="page" id="page2">
         <footer data-role="footer" class="revealed" id="footerPage2">
       <footer data-role="footer" class="revealed" id="footerAppWide">
     </div>  <!-- end of Pagestack div -->

PageID | Null currentPage( )

Gets the id attribute of the page element on top of this pagestack

Returns: <PageID | Null>
  • The topmost page's id attribute, else null when there are no pages on this pagestack
Number depth( )

Gets the number of pages in this pagestack

Returns: <Number>
  • The number of pages in this pagestack
Boolean isEmpty( )

Checks for zero pages in this pagestack

Returns: <Boolean>
  • True when this pagestack has no pages, else false
pop( )

Pops the current page off this pagestack, which causes the next page to become the top page and to display

push( id, properties )

Push a page to the top of this pagestack

  • id <String>
    • The id attribute of the page element to be pushed
  • properties <Object>
    • This param is not currently used