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(); + } +}