UbuntuUI.Popover

Class UbuntuUI.Popover

Class defined in: 0.1/ambiance/js/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 data-gravity="LETTER" 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 )

0.1/ambiance/js/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");

Methods

hide ( )

0.1/ambiance/js/popovers.js:143

Hide a Popover


show ( )

0.1/ambiance/js/popovers.js:66

Display a Popover


toggle ( )

0.1/ambiance/js/popovers.js:153

Toggle show/hide status of a Popover