Bug 195393 Use phase="target" r=varga sr=jag

This commit is contained in:
neil%parkwaycc.co.uk 2003-03-06 10:01:01 +00:00
parent 1b6885bd21
commit 3c806ac954
3 changed files with 22 additions and 28 deletions

View File

@ -488,9 +488,9 @@
</implementation>
<handlers>
<handler event="keypress" keycode="vk_up">
<handler event="keypress" keycode="vk_up" phase="target">
<![CDATA[
if (event.target != this || this.selectedItems.length < 1)
if (this.selectedItems.length < 1)
return;
this._isUpSelection=0;
this._isDownSelection=0;
@ -501,11 +501,8 @@
}
]]>
</handler>
<handler event="keypress" keycode="vk_down">
<handler event="keypress" keycode="vk_down" phase="target">
<![CDATA[
if (event.target != this)
return;
var n;
if (this.selectedItems.length == 0) {
n = this.getItemAtIndex(0);
@ -522,10 +519,10 @@
}
]]>
</handler>
<handler event="keypress" modifiers="shift" keycode="vk_up">
<handler event="keypress" modifiers="shift" keycode="vk_up" phase="target">
<![CDATA[
var l=this.selectedItems.length;
if (event.target != this || l < 1 || this.selType != "multiple")
if (l < 1 || this.selType != "multiple")
return;
var n = this.getPreviousItem(this.selectedItems[l-1], 1);
if (n) {
@ -543,10 +540,10 @@
}
]]>
</handler>
<handler event="keypress" modifiers="shift" keycode="vk_down">
<handler event="keypress" modifiers="shift" keycode="vk_down" phase="target">
<![CDATA[
var l=this.selectedItems.length;
if (event.target != this || l < 1 || this.selType != "multiple")
if (l < 1 || this.selType != "multiple")
return;
var n = this.getNextItem(this.selectedItems[l-1], 1);
if (n) {
@ -564,10 +561,10 @@
}
]]>
</handler>
<handler event="keypress" keycode="vk_page_up">
<handler event="keypress" keycode="vk_page_up" phase="target">
<![CDATA[
var l = this.selectedItems.length;
if (event.target != this || l < 1)
if (l < 1)
return;
this._isUpSelection=0;
this._isDownSelection=0;
@ -587,10 +584,10 @@
this.timedSelect(n, 500);
]]>
</handler>
<handler event="keypress" keycode="vk_page_down">
<handler event="keypress" keycode="vk_page_down" phase="target">
<![CDATA[
var l = this.selectedItems.length;
if (event.target != this || l < 1)
if (l < 1)
return;
this._isUpSelection=0;
this._isDownSelection=0;
@ -612,9 +609,9 @@
this.timedSelect(n, 500);
]]>
</handler>
<handler event="keypress" keycode="vk_home">
<handler event="keypress" keycode="vk_home" phase="target">
<![CDATA[
if (event.target != this || this.selectedItems.length < 1)
if (this.selectedItems.length < 1)
return;
this._isUpSelection=0;
this._isDownSelection=0;
@ -622,9 +619,9 @@
this.selectItem(this.getItemAtIndex(0));
]]>
</handler>
<handler event="keypress" keycode="vk_end">
<handler event="keypress" keycode="vk_end" phase="target">
<![CDATA[
if (event.target != this || this.selectedItems.length < 1)
if (this.selectedItems.length < 1)
return;
this._isUpSelection=0;
this._isDownSelection=0;
@ -634,7 +631,7 @@
]]>
</handler>
<handler event="keypress" key=" ">
<handler event="keypress" key=" " phase="target">
<![CDATA[
if (this.currentItem &&
this.currentItem.getAttribute("type") == "checkbox" &&
@ -642,7 +639,7 @@
this.currentItem.checked = !this.currentItem.checked;
]]>
</handler>
<handler event="keypress">
<handler event="keypress" phase="target">
<![CDATA[
if (!this.disableKeyNavigation && event.charCode > 0 &&
!event.altKey && !event.ctrlKey && !event.shiftKey && !event.metaKey) {

View File

@ -142,7 +142,6 @@
<![CDATA[
var currentElement = this.focusedItem;
// If focused item isn't a radio button, do nothing!
// (This allows textbox to work inside a radiogroup)
if (!currentElement)
return;
var index, i;
@ -279,7 +278,7 @@
using the arrow keys. Accessing previous or following radio buttons
is done solely through the arrow keys and not the tab button. Tab
takes you to the next widget in the tab order -->
<handler event="keypress" key=" ">
<handler event="keypress" key=" " phase="target">
this.selectedItem = this.focusedItem;
this.selectedItem.doCommand();
</handler>
@ -305,11 +304,9 @@
it is not (Windows platform behaviour is for the group to receive focus,
not the item -->
<handler event="focus" phase="target">
if (event.target == this) {
this.setAttribute("focused", "true");
if (!this.focusedItem)
this.focusedItem = this.selectedItem;
}
this.setAttribute("focused", "true");
if (!this.focusedItem)
this.focusedItem = this.selectedItem;
</handler>
<handler event="blur" phase="target">
this.removeAttribute("focused");

View File

@ -996,7 +996,7 @@
</implementation>
<handlers>
<handler event="click" button="0" action="if (event.originalTarget == this) { this.parentNode.parentNode.treeBoxObject.view.cycleHeader(this.id, this); }"/>
<handler event="click" button="0" phase="target" action="this.parentNode.parentNode.treeBoxObject.view.cycleHeader(this.id, this);"/>
</handlers>
</binding>