From 526c4e0934283c08c43bc63e02183b949a891451 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 20 Dec 2006 22:54:46 +0000 Subject: [PATCH] Monotone-Parent: 471935c8bdc2cfc136eb85128892971dcf39e208 Monotone-Revision: 3f4219a57994d48948bd4148cb90b8d4c2c820df Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-20T22:54:46 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/WebServerResources/HTMLElement.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a90c9199..fe4067f4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-12-20 Wolfgang Sourdeau + * UI/WebServerResources/HTMLElement.js: replaced the functional + selectNode() and deselectNode() functions with select() and + deselect() methods of HTMLElement. + * UI/WebServerResources/ContactsUI.js: cleanup, most of the events are initialized from here now instead of in the HTML code. diff --git a/UI/WebServerResources/HTMLElement.js b/UI/WebServerResources/HTMLElement.js index dc4b125c6..9b18e9275 100644 --- a/UI/WebServerResources/HTMLElement.js +++ b/UI/WebServerResources/HTMLElement.js @@ -177,3 +177,19 @@ HTMLElement.prototype.attachMenu = function(menuName) { this.sogoContextMenu = $(menuName); this.addEventListener("contextmenu", this.onContextMenu, true); } + +HTMLElement.prototype.select = function() { + this.addClassName('_selected'); +} + +HTMLElement.prototype.deselect = function() { + this.removeClassName('_selected'); +} + +HTMLElement.prototype.deselectAll = function () { + for (var i = 0; i < this.childNodes.length; i++) { + var node = this.childNodes.item(i); + if (node.nodeType == 1) + node.deselect(); + } +}