diff --git a/src/www/js/Search.js b/src/www/js/Search.js
index 282eefb..b74fb30 100644
--- a/src/www/js/Search.js
+++ b/src/www/js/Search.js
@@ -112,12 +112,15 @@ Dragonfly.Search.Contacts.connectHtml = function (elem)
{
var d = Dragonfly;
- s.Group.prototype.connectHtml.apply (this, arguments);
- $('contacts-search-results').style.overflow = 'auto';
+ //d.Search.Contacts.prototype.connectHtml.apply (this, arguments);
+ //$('contacts-search-results').style.overflow = 'auto';
+ logDebug('Observing contacts-search-results.');
Event.observe ('contacts-search-results', 'click',
(function (evt) {
var elem = Event.element (evt);
- var card = d.findElement (elem, 'TABLE', $('contacts-search'));
+ logDebug('Element: ' + elem);
+ var card = d.findElement (elem, 'TR', $('contacts-search'));
+ logDebug('Card (element): ' + card);
var bongoId = card && card.getAttribute ('bongoid');
if (!bongoId) {
return;
@@ -141,21 +144,18 @@ Dragonfly.Search.Contacts.load = function (loc, jsob)
var rowtype = 'even';
forEach (jsob.contacts, function (card) {
- html.push ('
');
+ html.push ('
');
html.push (' | ');
- //html.push (' | ');
+ html.push (' | ');
- var loc = new d.Location ({ tab: 'mail', set:'all', handler:'contacts',
- contact: card.bongoId });
-
- html.push ('');
- html.push ('', d.escapeHTML (card.fn), '');
+ html.push (' | ');
+ html.push ('', d.escapeHTML (card.fn), '');
html.push (' | ');
if (card.email && card.email.length) {
- html.push ('');
- html.push ('', d.escapeHTML (card.email[0]), '');
+ html.push (' | ');
+ html.push ('', d.escapeHTML (card.email[0]), '');
html.push (' | ');
}
@@ -178,8 +178,9 @@ Dragonfly.Search.Contacts.load = function (loc, jsob)
jsob.total - jsob.contacts.length, ' More...' ]);
}
- }
+ }
html.set ('contacts-search-results');
+ d.Search.Contacts.connectHtml();
(ret ? Element.show : Element.hide) ('contacts-search');
return ret;
};
@@ -202,7 +203,11 @@ Dragonfly.Search.Events.load = function (loc, jsob)
forEach (jsob, function (res) {
html.push('
');
- html.push ('| Event: | ');
+ html.push (' | ');
+
+ html.push (' | ');
+
+ html.push (' | ');
html.push ('',
d.escapeHTML (res.occurrences[0].summary.value),
diff --git a/src/www/js/Util.js b/src/www/js/Util.js
index 4479078..a0946d0 100644
--- a/src/www/js/Util.js
+++ b/src/www/js/Util.js
@@ -216,10 +216,9 @@ Element.setHTML = function (elem, html)
if (!elem) {
logError ('Could not find element ' + Element.repr(elem, origElem));
}
-
- html = html.join ? html.join ('') : html;
-
+
try {
+ html = html.join ? html.join ('') : html;
elem.innerHTML = html;
} catch (e) {
logError ('could not set html on ' + Element.repr(elem, origElem) + ': ' + repr (e) + ': |' + html + '|');
|