From 5f8af8df55fc5610856733d905f6fef1807bb9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Thu, 14 Jan 2010 19:55:41 +0100 Subject: [PATCH] Handle buddy list keypress events on groups and buddies separately. --- im/content/blist.js | 22 +--------------------- im/content/buddy.xml | 15 +++++++++++++++ im/content/group.xml | 24 ++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/im/content/blist.js b/im/content/blist.js index 2a9e659856..0685a72d4c 100644 --- a/im/content/blist.js +++ b/im/content/blist.js @@ -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); } }; diff --git a/im/content/buddy.xml b/im/content/buddy.xml index e9cf7e6eee..9bbe8a1391 100644 --- a/im/content/buddy.xml +++ b/im/content/buddy.xml @@ -264,6 +264,21 @@ ]]> + + + + + + + diff --git a/im/content/group.xml b/im/content/group.xml index 1f01e63d5b..1cec04b3ab 100644 --- a/im/content/group.xml +++ b/im/content/group.xml @@ -272,6 +272,30 @@ ]]> + + + + + + +