home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <!DOCTYPE bindings SYSTEM "chrome://yasearch/locale/dialogs/welcome.dtd">
-
- <bindings xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xbl="http://www.mozilla.org/xbl"
- xmlns:html="http://www.w3.org/1999/xhtml">
-
- <binding id="scrollbar" extends="chrome://global/content/bindings/scrollbar.xml#scrollbar">
- <resources>
- <stylesheet src="chrome://yasearch/skin/dialogs/scrollbar.css"/>
- </resources>
-
- <implementation>
-
- <field name="friend">document.getElementById("ya-status-textarea")</field>
-
- <property name="maxpos" onset="this.setAttribute('maxpos', val);" onget="return this.getAttribute('maxpos');"/>
- <property name="curpos" onset="this.setAttribute('curpos', val);" onget="return this.getAttribute('curpos');"/>
-
- <constructor><![CDATA[
- this.setAttribute("hidden", "true");
-
- this.friend.style.marginRight = "-" + (this.friend.offsetWidth - this.friend.clientWidth) + "px";
-
- function bind(handler, context) {
- var __arguments__ = arguments;
- return function() { return handler.call(context, Array.slice.call(__arguments__, 2)); };
- }
-
- var events = ["scroll", "change", "keydown", "keypress", "cut", "paste"];
- for (var i = events.length; i--;)
- this.friend.addEventListener(events[i], bind(this.update, this), true);
-
- this.friend.addEventListener("overflow", bind(this.onOverflow, this), true);
- this.friend.addEventListener("underflow", bind(this.onUnderflow, this), true);
-
- this.update();
- ]]></constructor>
-
- <method name="update">
- <body><![CDATA[
- this.maxpos = this.friend.scrollHeight - this.friend.clientHeight;
- this.curpos = this.friend.scrollTop;
- ]]></body>
- </method>
-
- <method name="onOverflow">
- <body><![CDATA[
- this.removeAttribute("hidden");
- this.update();
- ]]></body>
- </method>
-
- <method name="onUnderflow">
- <body><![CDATA[
- this.setAttribute("hidden", "true");
- ]]></body>
- </method>
-
- </implementation>
-
- <handlers>
- <handler event="DOMAttrModified"><![CDATA[
- this.friend.scrollTop = this.curpos;
- ]]></handler>
- </handlers>
- </binding>
- </bindings>