Handle buddy list keypress events on groups and buddies separately.
This commit is contained in:
Родитель
e6ea1bd734
Коммит
5f8af8df55
|
@ -221,27 +221,7 @@ var buddyList = {
|
|||
var item = document.getElementById("buddylistbox").selectedItem;
|
||||
if (!item) // the list is empty
|
||||
return;
|
||||
|
||||
switch (aEvent.keyCode) {
|
||||
// If Enter or Return is pressed, open a new conversation
|
||||
case aEvent.DOM_VK_RETURN:
|
||||
case aEvent.DOM_VK_ENTER:
|
||||
if (item.localName == "buddy")
|
||||
item.openConversation();
|
||||
else if (item.localName == "group")
|
||||
item.close();
|
||||
break;
|
||||
|
||||
case aEvent.DOM_VK_LEFT:
|
||||
if (item.localName == "group" && !item.hasAttribute("closed"))
|
||||
item.close();
|
||||
break;
|
||||
|
||||
case aEvent.DOM_VK_RIGHT:
|
||||
if (item.localName == "group" && item.hasAttribute("closed"))
|
||||
item.close();
|
||||
break;
|
||||
}
|
||||
item.keyPress(aEvent);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -264,6 +264,21 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="keyPress">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
switch (aEvent.keyCode) {
|
||||
// If Enter or Return is pressed, open a new conversation
|
||||
case aEvent.DOM_VK_RETURN:
|
||||
case aEvent.DOM_VK_ENTER:
|
||||
this.openConversation();
|
||||
break;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="click" clickcount="2" action="openConversation();"/>
|
||||
|
|
|
@ -272,6 +272,30 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="keyPress">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
switch (aEvent.keyCode) {
|
||||
case aEvent.DOM_VK_RETURN:
|
||||
case aEvent.DOM_VK_ENTER:
|
||||
this.close();
|
||||
break;
|
||||
|
||||
case aEvent.DOM_VK_LEFT:
|
||||
if (!this.hasAttribute("closed"))
|
||||
this.close();
|
||||
break;
|
||||
|
||||
case aEvent.DOM_VK_RIGHT:
|
||||
if (this.hasAttribute("closed"))
|
||||
this.close();
|
||||
break;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="click">
|
||||
|
|
Загрузка…
Ссылка в новой задаче