ElementLayer
| Package: | CQ.Ext |
| Class: | Layer |
| Extends: | CQ.Ext.Element |
| Clientlib: | cq.widgets |
| Config Options | Defined By | |
|---|---|---|
|
cls : String
CSS class to add to the element
|
Layer | |
|
constrain : Boolean
False to disable constrain to viewport (defaults to true)
|
Layer | |
|
dh : Object
DomHelper object config to create element with (defaults to {tag: 'div', cls: 'x-layer'}).
|
Layer | |
|
shadow : String/Boolean True to automatically create an CQ.Ext.Shadow, or a string indicating the shadow's display CQ.Ext.Shadow.mode. False ...
True to automatically create an CQ.Ext.Shadow, or a string indicating the shadow's display CQ.Ext.Shadow.mode. False to disable the shadow. (defaults to false)
|
Layer | |
|
shadowOffset : Number
Number of pixels to offset the shadow (defaults to 4)
|
Layer | |
|
shim : Boolean
False to disable the iframe shim in browsers which need one (defaults to true)
|
Layer | |
|
useDisplay : Boolean Defaults to use css offsets to hide the Layer. Specify true to use css style 'display:none;' to hide the Layer.
Defaults to use css offsets to hide the Layer. Specify true to use css style 'display:none;' to hide the Layer.
|
Layer | |
|
zindex : Number
Starting z-index (defaults to 11000)
|
Layer | |
| Method | Defined By | |
|---|---|---|
Layer( Object config, [String/HTMLElement existingEl] )
Parameters:
|
Layer | |
child( String selector, [Boolean returnDom] ) : HTMLElement/CQ.Ext.Element Selects a single child at any depth below this element based on the passed CSS selector (the selector should not cont...
Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id).
Parameters:
|
Element | |
down( String selector, [Boolean returnDom] ) : HTMLElement/CQ.Ext.Element Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).
Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).
Parameters:
|
Element | |
findParent( String selector, [Number/Mixed maxDepth], [Boolean returnEl] ) : HTMLElement Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:fi...
Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
Parameters:
|
Element | |
findParentNode( String selector, [Number/Mixed maxDepth], [Boolean returnEl] ) : HTMLElement Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
Parameters:
|
Element | |
first( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the first child, skipping text nodes
Gets the first child, skipping text nodes
Parameters:
|
Element | |
fly( String/HTMLElement el, [String named] ) : Element Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to t...
Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element - the dom node can be overwritten by other code. Shorthand of CQ.Ext.Element.fly Use this to make one-time references to DOM elements which are not going to be accessed again either by application code, or by Ext's classes. If accessing an element which will be processed regularly, then CQ.Ext.get will be more appropriate to take advantage of the caching provided by the CQ.Ext.Element class.
Parameters:
|
Element | |
getTextWidth( String text, [Number min], [Number max] ) : Number Returns the width in pixels of the passed text, or the width of the text in this Element.
Returns the width in pixels of the passed text, or the width of the text in this Element.
Parameters:
|
Element | |
last( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the last child, skipping text nodes
Gets the last child, skipping text nodes
Parameters:
|
Element | |
next( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the next sibling, skipping text nodes
Gets the next sibling, skipping text nodes
Parameters:
|
Element | |
on( String eventName, Function fn, [Object scope], [Object options] ) : void Appends an event handler (shorthand for addListener).
Appends an event handler (shorthand for addListener).
Parameters:
|
Element | |
parent( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the parent node for this element, optionally chaining up trying to match a selector
Gets the parent node for this element, optionally chaining up trying to match a selector
Parameters:
|
Element | |
prev( [String selector], [Boolean returnDom] ) : CQ.Ext.Element/HTMLElement Gets the previous sibling, skipping text nodes
Gets the previous sibling, skipping text nodes
Parameters:
|
Element | |
query( String selector ) : Array Selects child nodes based on the passed CSS selector (the selector should not contain an id).
Selects child nodes based on the passed CSS selector (the selector should not contain an id).
Parameters:
|
Element | |
select( String/Array selector, [HTMLElement/String root] ) : CompositeElementLite/CompositeElement Selects elements based on the passed CSS selector to enable Element methods
to be applied to many related elements in...
Selects elements based on the passed CSS selector to enable Element methods
to be applied to many related elements in one statement through the returned CompositeElement or
CompositeElementLite object.
Parameters:
|
Element | |
setZIndex( Number zindex ) : this Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically
incremen...
Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically
incremented by two more than the value passed in so that it always shows above any shadow or shim (the shadow
element, if any, will be assigned z-index + 1, and the shim element, if any, will be assigned the unmodified z-index).
Parameters:
|
Layer | |
un( String eventName, Function fn, Object scope ) : CQ.Ext.Element Removes an event handler from this element (see removeListener for additional notes).
Removes an event handler from this element (see removeListener for additional notes).
Parameters:
|
Element | |
up( String selector, [Number/Mixed maxDepth] ) : CQ.Ext.Element Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first...
Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).
This is a shortcut for findParentNode() that always returns an CQ.Ext.Element.
Parameters:
|
Element | |