Monotone-Parent: 9c6dc6a8ae6889a9f5df735cb84d50ea6a07241d

Monotone-Revision: 8aa07a8f048c7e50cdc15d7dd7aa1b00d822b02f

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-10-02T14:52:47
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2007-10-02 14:52:47 +00:00
parent 0685bba9a5
commit 43af980501
1 changed files with 25 additions and 0 deletions

View File

@ -156,6 +156,31 @@ Element.addMethods({
element.addClassName('_selected');
},
selectRange: function(element, startIndex, endIndex) {
element = $(element);
var s;
var e;
var rows;
if (startIndex > endIndex) {
s = endIndex;
e = startIndex;
}
else {
s = startIndex;
e = endIndex;
}
if (element.tagName == 'UL')
rows = element.getElementsByTagName('LI');
else
rows = element.getElementsByTagName('TR');
while (s <= e) {
if (rows[s].nodeType == 1)
$(rows[s]).select();
s++;
}
},
deselect: function(element) {
element = $(element);
element.removeClassName('_selected');