зеркало из https://github.com/mozilla/pjs.git
bug 213228: new toolkit independence bug, part 7: update and use the new toolkit widgetry.
scrollbox.xml: bug 97787 by neil
This commit is contained in:
Родитель
385129206c
Коммит
83321dc0da
|
@ -11,7 +11,7 @@
|
||||||
</resources>
|
</resources>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="scrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
|
<binding id="scrollbox" extends="chrome://global/content/widgets/scrollbox.xml#scrollbox-base">
|
||||||
<content>
|
<content>
|
||||||
<xul:box class="box-inherit scrollbox-innerbox" xbl:inherits="orient,align,pack,dir">
|
<xul:box class="box-inherit scrollbox-innerbox" xbl:inherits="orient,align,pack,dir">
|
||||||
<children/>
|
<children/>
|
||||||
|
@ -19,16 +19,34 @@
|
||||||
</content>
|
</content>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="arrowscrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
|
<binding id="arrowscrollbox" extends="chrome://global/content/widgets/scrollbox.xml#scrollbox-base">
|
||||||
<content>
|
<content>
|
||||||
<xul:autorepeatbutton class="autorepeatbutton-up" scrolldir="up" collapsed="true"/>
|
<xul:autorepeatbutton class="autorepeatbutton-up" collapsed="true"
|
||||||
|
oncommand="this.parentNode.scrollByIndex(-1); event.preventBubble();"/>
|
||||||
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1">
|
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1">
|
||||||
<children/>
|
<children/>
|
||||||
</xul:scrollbox>
|
</xul:scrollbox>
|
||||||
<xul:autorepeatbutton class="autorepeatbutton-down" scrolldir="down" collapsed="true"/>
|
<xul:autorepeatbutton class="autorepeatbutton-down" collapsed="true"
|
||||||
|
oncommand="this.parentNode.scrollByIndex(1); event.preventBubble();"/>
|
||||||
</content>
|
</content>
|
||||||
|
|
||||||
|
<implementation>
|
||||||
|
<method name="scrollByIndex">
|
||||||
|
<parameter name="lines"/>
|
||||||
|
<body><![CDATA[
|
||||||
|
if (!("mScrollBoxObject" in this)) {
|
||||||
|
var kids = document.getAnonymousNodes(this);
|
||||||
|
this.mScrollBoxObject = kids[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mScrollBoxObject.scrollByIndex(lines);
|
||||||
|
]]></body>
|
||||||
|
</method>
|
||||||
|
</implementation>
|
||||||
|
|
||||||
<handlers>
|
<handlers>
|
||||||
|
<handler event="DOMMouseScroll" action="this.scrollByIndex(event.detail); event.preventBubble();"/>
|
||||||
|
|
||||||
<handler event="underflow"><![CDATA[
|
<handler event="underflow"><![CDATA[
|
||||||
var kids = document.getAnonymousNodes(this);
|
var kids = document.getAnonymousNodes(this);
|
||||||
kids[0].collapsed = true;
|
kids[0].collapsed = true;
|
||||||
|
@ -45,23 +63,10 @@
|
||||||
</handlers>
|
</handlers>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="autorepeatbutton" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
|
<binding id="autorepeatbutton" extends="chrome://global/content/widgets/scrollbox.xml#scrollbox-base">
|
||||||
<content>
|
<content>
|
||||||
<xul:image class="autorepeatbutton-icon"/>
|
<xul:image class="autorepeatbutton-icon"/>
|
||||||
</content>
|
</content>
|
||||||
|
|
||||||
<handlers>
|
|
||||||
<handler event="command"><![CDATA[
|
|
||||||
if (!("mScrollBox" in this)) {
|
|
||||||
var kids = document.getAnonymousNodes(parentNode);
|
|
||||||
this.mScrollBox = kids[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
var dir = this.getAttribute("scrolldir");
|
|
||||||
var bx = this.mScrollBox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
|
||||||
bx.scrollByIndex(dir == "up" ? -1 : 1);
|
|
||||||
]]></handler>
|
|
||||||
</handlers>
|
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
</bindings>
|
</bindings>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче