Bug 377686, listbox.xml/richlistbox.xml cleanup, Patch by Simon Bünzli, r=enn

This commit is contained in:
flamingice@sourmilk.net 2007-06-15 12:42:31 -07:00
Родитель 44ed86e0ec
Коммит 46b64064cd
2 изменённых файлов: 27 добавлений и 44 удалений

Просмотреть файл

@ -548,6 +548,33 @@
<field name="_currentItem">null</field>
<field name="_selectionStart">null</field>
</implementation>
<handlers>
<handler event="keypress" keycode="VK_UP" modifiers="control shift any"
action="moveByOffset(-1, !event.ctrlKey, event.shiftKey);"
phase="target" preventdefault="true"/>
<handler event="keypress" keycode="VK_DOWN" modifiers="control shift any"
action="moveByOffset(1, !event.ctrlKey, event.shiftKey);"
phase="target" preventdefault="true"/>
<handler event="keypress" keycode="VK_HOME" modifiers="control shift any"
action="moveByOffset(-this.currentIndex, !event.ctrlKey, event.shiftKey);"
phase="target" preventdefault="true"/>
<handler event="keypress" keycode="VK_END" modifiers="control shift any"
action="moveByOffset(this.getRowCount() - this.currentIndex - 1, !event.ctrlKey, event.shiftKey);"
phase="target" preventdefault="true"/>
<handler event="keypress" keycode="VK_PAGE_UP" modifiers="control shift any"
action="moveByOffset(this.scrollOnePage(-1), !event.ctrlKey, event.shiftKey);"
phase="target" preventdefault="true"/>
<handler event="keypress" keycode="VK_PAGE_DOWN" modifiers="control shift any"
action="moveByOffset(this.scrollOnePage(1), !event.ctrlKey, event.shiftKey);"
phase="target" preventdefault="true"/>
<handler event="keypress" key=" " modifiers="control" phase="target">
<![CDATA[
if (this.currentItem && this.selType == "multiple")
this.toggleItemSelection(this.currentItem);
]]>
</handler>
</handlers>
</binding>
@ -707,18 +734,6 @@
</implementation>
<handlers>
<handler event="keypress" keycode="VK_UP" modifiers="control shift any"
phase="target" action="moveByOffset(-1, !event.ctrlKey, event.shiftKey);"/>
<handler event="keypress" keycode="VK_DOWN" modifiers="control shift any"
phase="target" action="moveByOffset(1, !event.ctrlKey, event.shiftKey);"/>
<handler event="keypress" keycode="VK_HOME" modifiers="control shift any"
phase="target" action="moveByOffset(-this.currentIndex, !event.ctrlKey, event.shiftKey);"/>
<handler event="keypress" keycode="VK_END" modifiers="control shift any"
phase="target" action="moveByOffset(this.getRowCount() - this.currentIndex - 1, !event.ctrlKey, event.shiftKey);"/>
<handler event="keypress" keycode="VK_PAGE_UP" modifiers="control shift any"
phase="target" action="moveByOffset(this.scrollOnePage(-1), !event.ctrlKey, event.shiftKey);"/>
<handler event="keypress" keycode="VK_PAGE_DOWN" modifiers="control shift any"
phase="target" action="moveByOffset(this.scrollOnePage(1), !event.ctrlKey, event.shiftKey);"/>
<handler event="keypress" key=" " phase="target">
<![CDATA[
if (this.currentItem) {
@ -737,12 +752,6 @@
this._lastKeyTime = 0;
]]>
</handler>
<handler event="keypress" key=" " modifiers="control" phase="target">
<![CDATA[
if (this.currentItem && this.selType == "multiple")
this.toggleItemSelection(this.currentItem);
]]>
</handler>
<handler event="keypress" phase="target">
<![CDATA[
if (!this.disableKeyNavigation && event.charCode > 0 &&

Просмотреть файл

@ -460,32 +460,6 @@
</implementation>
<handlers>
<!-- handle keyboard navigation also when a child element has got the focus -->
<handler event="keypress" keycode="VK_UP"
modifiers="control shift any"
action="this.moveByOffset(-1, !event.ctrlKey, event.shiftKey);"
preventdefault="true"/>
<handler event="keypress" keycode="VK_DOWN"
modifiers="control shift any"
action="this.moveByOffset(1, !event.ctrlKey, event.shiftKey);"
preventdefault="true"/>
<handler event="keypress" keycode="VK_HOME"
modifiers="control shift any"
action="this.moveByOffset(-this.currentIndex, !event.ctrlKey, event.shiftKey);"
preventdefault="true"/>
<handler event="keypress" keycode="VK_END"
modifiers="control shift any"
action="this.moveByOffset(this.getRowCount(), !event.ctrlKey, event.shiftKey);"
preventdefault="true"/>
<handler event="keypress" keycode="VK_PAGE_UP"
modifiers="control shift any"
action="this.moveByOffset(this.scrollOnePage(-1), !event.ctrlKey, event.shiftKey);"
preventdefault="true"/>
<handler event="keypress" keycode="VK_PAGE_DOWN"
modifiers="control shift any"
action="this.moveByOffset(this.scrollOnePage(1), !event.ctrlKey, event.shiftKey);"
preventdefault="true"/>
<handler event="click">
<![CDATA[
// clicking into nothing should unselect