basetabelement.lzx
<library>
<include href="base/baselistitem.lzx"/>
<class name="basetabelement" width="100%" focusable="true" styleable="false" extends="baselistitem" clickable="false">
<attribute name="hideonclose" value="true
"/>
<attribute name="contentvisible" value="$once{! hideonclose}"/>
<attribute name="itemclassname" value="
" type="string"/>
<attribute name="isopening" value="0
"/>
<attribute name="minheight" value="22
" type="number"/>
<attribute name="headerheight" value="$once{minheight}" type="number"/>
<attribute name="height" value="$once{minheight}"/>
<event name="onopenstart"/>
<event name="onopenstop"/>
<event name="onclosestart"/>
<event name="onclosestop"/>
<attribute name="_originalheight" value="null
"/>
<attribute name="dlo" value="null
"/>
<attribute name="dlc" value="null
"/>
<handler name="onconstruct">
this._originalheight = this.height;
if ( this.headerheight ) this.height = this.headerheight;
else this.height = this.minheight;
</handler>
<method name="open" args="h,d,withAnimation">
this.setAttribute( "contentvisible" , true );
this.isopening += 1;
if ( this.onopenstart ) this.onopenstart.sendEvent();
if( withAnimation ) {
var anm = this.animate( "height", h, d, true );
if ( !this.dlo ) this.dlo = new LzDelegate( this, "openned" );
this.dlo.register( anm, "onstop" );
} else {
this.setAttribute( "height", h+this.minheight );
this.openned(null);
}
this.setAttribute ('focusable' , false );
</method>
<method name="close" args="h,d">
var anm = this.animate( "height", h, d, true );
if ( this.onclosestart ) this.onclosestart.sendEvent();
if ( !this.dlc ) this.dlc = new LzDelegate( this,"closed" );
this.dlc.register( anm, "onstop" );
this.setAttribute( 'focusable' , true );
</method>
<method name="setSelected" args="isSelected">
super.setSelected( isSelected );
if ( !parent._initcomplete ) return;
if ( isSelected ) {
this.open( parent.availableheight, parent.slideduration, true );
} else {
this.close( -parent.availableheight, parent.slideduration );
}
</method>
<method name="_setSelected" args="s">
if (s && !this["selected"]) {
super._setSelected(s);
}
</method>
<method name="doSpaceUp">
this.setAttribute( 'selected' , true );
</method>
<method name="openned" args="ignore">
if ( this.onopenstop ) this.onopenstop.sendEvent();
this.isopening -= 1;
if (this.isopening == 0) {
//now we can savely call unregisterAll
if (this.dlo) {
this.dlo.unregisterAll();
}
}
</method>
<method name="closed" args="ignore">
if ( this.onclosestop ) this.onclosestop.sendEvent();
// stop listening for close events
this.dlc.unregisterAll();
if ( this.isopening < 1 && this.hideonclose ) {
this.setAttribute( "contentvisible" , false );
//need to recheck the default to update the default button
this.updateDefault();
}
</method>
<doc>
<tag name="shortdesc"><text>Base class for the contents of a basetabslider.</text></tag>
<text>
<p><classname>basetabelement</classname> is the base class for the
contents of a <classname>basetabslider</classname>. The
<classname>basetabelement</classname> is focusable
if it is closed, and not focusable when it is open.</p>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes