API Docs for: HTML-14.04-dev~bzr202

Class UbuntuUI.Popover

Class defined in: popovers.js:23

A Popover is a div containng markup that can pop up and disappear. (Unlike a Dialog, Popovers are not full screen.)

A Popoves often contain a List whose items are connected to useful JavaScript functions.

######Popover Position The Popover's position is set relative to a specified base element with the <em>data-gravity="LETTER"</em> attribute. LETTER values:

  • 'n': the base element is above the Popover
  • 's': the base element is below the Popover
  • 'e': the base element is to the east of (to the right of) the Popover (in right-to-left locales)
  • 'w': the base element is to the west of (to the left of) the Popover (in right-to-left locale)
UbuntuUI.Popover( elem, id )
popovers.js:23
Parameters:
  • elem <String>
    • The element to which the Popover's position is relative
  • id <ID>
    • The id attribute of the Popover in HTML
Example
 <p id="popoverBase">Text</p>
     <div class="popover active" data-gravity="n" id="popover">
       <ul class="list">
         <li class="active"><a href="#">Item1</a></li>
         <li><a href="#">Item2</a></li>
       </ul>
     </div>
    
     Javascript:
     var popBase = document.getElementById("popoverBase");
     var popover = UI.popover(popBase, "popover");
element( )
popovers.js:230

Returns the DOM element associated with the id this widget is bind to.

Example
   var mypopover = UI.popover("popoverid").element();
hide( )
popovers.js:143

Hide a Popover

show( )
popovers.js:66

Display a Popover

toggle( )
popovers.js:153

Toggle show/hide status of a Popover