Created
September 23, 2012 09:39
-
-
Save aurimasv/3769513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bindings xmlns="http://www.mozilla.org/xbl" | |
xmlns:xbl="http://www.mozilla.org/xbl" | |
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | |
<binding id="tab-counter" extends="chrome://global/content/bindings/tabbox.xml#tab"> | |
<content> | |
<xul:hbox class="tab-middle box-inherit" xbl:inherits="align,dir,pack,orient,selected" flex="1"> | |
<xul:image class="tab-icon" xbl:inherits="validate,src=image" role="presentation"/> | |
<xul:label class="tab-text" xbl:inherits="value=label,accesskey,crop,disabled" flex="1" role="presentation"/> | |
<xul:label class="tab-counter" xbl:inherits="value=_counterLabel" role="presentation"/> | |
</xul:hbox> | |
</content> | |
<implementation> | |
<property name="count"> | |
<setter> | |
<![CDATA[ | |
var v = parseInt(val, 10); | |
if(!isNaN(v) && v >= 0) { | |
this.setAttribute('count', v); | |
this.setAttribute('_counterLabel', '(' + v + ')'); | |
} | |
]]> | |
</setter> | |
<getter> | |
return this.getAttribute('count'); | |
</getter> | |
</property> | |
<property name="_counterLabel" onget="return this.getAttribute('_counterLabel');" onset="this.setAttribute('_counterLabel', val);"/> | |
</implementation> | |
</binding> | |
</bindings> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment