Edit this page

API class up.Layer

Each layer has an up.Layer instance.

Most functions in the up.layer package interact with the current layer. For example, up.layer.dismiss() is a shortcut for up.layer.current.dismiss().

up.layer.current is set to the right layer in compilers and most events, even if that layer is not the frontmost layer. E.g. if you're compiling a fragment for a background layer, up.layer.current will be the background layer during compilation.

All features

JS
up.Layer.prototype.accept([value], [options]) stable

Closes this overlay with an accepting intent, e.g. when a change was confirmed or when a value was selected.

JS
up.Layer.prototype.affix(selector, attrs) experimental

Creates an element with the given selector and appends it to this layer's outmost element.

JS
up.Layer.prototype.align stable

The alignment of this popup overlay.

JS
up.Layer.prototype.ancestors stable

Returns an array of this layer's ancestor layers.

JS
up.Layer.prototype.asCurrent(fn) experimental

Temporarily changes the current layer while the given function is running.

JS
up.Layer.prototype.child stable

Returns this layer's child layer.

JS
up.Layer.prototype.contains(element) stable

Returns whether the given element is contained by this layer.

JS
up.Layer.prototype.context experimental

This layer's context.

JS
up.Layer.prototype.descendants stable

Returns an array of this layer's descendant layers, with the closest descendants listed first.

JS
up.Layer.prototype.dismiss([value], [options]) stable

Closes this overlay without an accepting intent, e.g. when a "Cancel" button was clicked.

JS
up.Layer.prototype.element stable

This layer's outmost element.

JS
up.Layer.prototype.emit([target], eventType, [props]) stable

Emits an event on this layer's element.

JS
up.Layer.prototype.history stable

Whether fragment updates within this layer can affect browser history and window title.

JS
up.Layer.prototype.index stable

Returns the zero-based position of this layer in the layer stack.

JS
up.Layer.prototype.isClosed() stable

Returns whether this layer is no longer part of the layer stack.

JS
up.Layer.prototype.isCurrent() stable

Returns whether this layer is the current layer.

JS
up.Layer.prototype.isFront() stable

Returns whether this layer is the frontmost layer.

JS
up.Layer.prototype.isOpen() stable

Returns whether this layer is still part of the layer stack.

JS
up.Layer.prototype.isOverlay() stable

Returns whether this layer is not the root layer.

JS
up.Layer.prototype.isRoot() stable

Returns whether this layer is the root layer.

JS
up.Layer.prototype.location experimental

This layer's location URL.

JS
up.Layer.prototype.mode stable

This layer's mode which governs its appearance and behavior.

JS
up.Layer.prototype.off(events, [selector], listener) stable

Unbinds an event listener previously bound with up.Layer#on().

JS
up.Layer.prototype.on(types, [selector], [options], listener) stable

Listens to a DOM event that originated on an element contained by this layer.

JS
up.Layer.prototype.origin stable

The link or form element that opened this overlay.

JS
up.Layer.prototype.parent stable

Returns this layer's parent layer.

JS
up.Layer.prototype.peel(options) stable

Dismisses all descendant overlays, making this layer the frontmost layer in the layer stack.

JS
up.Layer.prototype.position stable

The position of this popup overlay.

JS
up.Layer.prototype.size stable

The size of this overlay.

JS
up.Layer.prototype.subtree experimental

Returns an array of this layer and its descendant layers, with the closest descendants listed first.

JS
up.Layer.prototype.sync() experimental

Synchronizes this layer with the rest of the page.

JS
up.Layer.prototype.title experimental

This layer's window title.