LeptonJs/Ui

LeptonJS: The lepton.ui namespace

Classes in the lepton.ui namespace:

lepton.ui.Table

TODO: Render a paged table from a data provider

lepton.ui.Tooltip

NOTE: Not yet implemented

Creates a dynamic tooltip

var t = new lepton.ui.Tooltip([options]);

Options

OptionDefaultDescription
backgroundColor#404040The color of the tooltip as a hexadecimal color value
opacity0.7The opacity as a float (0.0 to 1.0 where 1.0 is fully opaque)
parentn/aThe parent element to attach to
textn/aThe text to display in the tooltip - can also be set in the show method

Methods

MethodDescription
show([text],[elem])Shows the tooltip (by the specified element, with the specified text)
hide()Hides the tooltip
setText(text)Sets the text of the tooltip

lepton.ui.bluebox

Sets up an overlay for images, similar to lightbox and other image overlays. Place this in your head

lepton.ui.bluebox.setup(class[,options]);

The class parameter should point to a specific CSS classname, such as "image" or "bluebox". All anchors with the specified class will be hooked to display in a bluebox overlay.

Options

OptionDefaultDescription
overlayColor#404040The color of the overlay as a hexadecimal color value

Methods

Bluebox has no methods

Just set each image to class 'bluebox' or whatever you set up in the setup(). That's it!

lepton.ui.Overlay

Creates an overlay on top of the page, fading out the content and switching focus to the relevant elements.

var o = new lepton.ui.Overlay([options]);

Options

OptionDefaultDescription
backgroundColor#404040The color of the overlay as a hexadecimal color value
opacity0.7The opacity as a float (0.0 to 1.0 where 1.0 is fully opaque)
zIndex9999The zIndex of the overlay

Methods

MethodDescription
show()Shows the overlay
hide()Hides the overlay

lepton.ui.InlineEditor

TODO: Converts an element into a editor

lepton.ui.Dialog

TODO: Converts an element into a floating dialog

lepton.ui.ToolBar

lepton.ui.TabBar

lepton.ui.Button

Creates a button to be added to the page, or to a toolbar or tabbar.

var b = new lepton.ui.Button(options,callback);

Options

OptionDefaultDescription
captionButtonThe caption of the button
idnoneThe id of the button element
iconnoneThe complete url of the icon to use

Callback

The callback is a function to call when the button is clicked. When using prototype within an object context, remember to bind properly:

var b = new Button({ caption:'Hello World' }, this.handleClick.bindAsEventListener(this));