* When searching for contacts, provide a ContactPopup, rather than a link to the contact's conversations.

* Get's rid of a minor niggle with 'html' being undefined at login screen.
This commit is contained in:
halex
2007-07-11 07:25:30 +00:00
parent 65a20db8f9
commit 58564815a6
2 changed files with 21 additions and 17 deletions
+19 -14
View File
@@ -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 ('<tr bongoid="', card.bongoId, '" class="', rowtype, '">');
html.push ('<tr id bongoid="', card.bongoId, '" class="', rowtype, '">');
html.push ('<td class="checkbox"><input type="checkbox"></td>');
//html.push ('<td class="star"><img src="img/contact-16.png" /></td>');
html.push ('<td class="star"><img src="img/contact-16.png" /></td>');
var loc = new d.Location ({ tab: 'mail', set:'all', handler:'contacts',
contact: card.bongoId });
html.push ('<td class="from" href="#', loc.getClientUrl(), '">');
html.push ('<a href="#', loc.getClientUrl(), '">', d.escapeHTML (card.fn), '</a>');
html.push ('<td class="from">');
html.push ('<a>', d.escapeHTML (card.fn), '</a>');
html.push ('</td>');
if (card.email && card.email.length) {
html.push ('<td class="subject" href="#', loc.getClientUrl(), '">');
html.push ('<a href="#', loc.getClientUrl(), '">', d.escapeHTML (card.email[0]), '</a>');
html.push ('<td class="subject" >');
html.push ('<a>', d.escapeHTML (card.email[0]), '</a>');
html.push ('</td>');
}
@@ -178,8 +178,9 @@ Dragonfly.Search.Contacts.load = function (loc, jsob)
jsob.total - jsob.contacts.length, ' More...</a>' ]);
}
}
}
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('<tr bongoId="', res.bongoId, '" class="', rowtype, '">');
html.push ('<td class="from">Event: </td>');
html.push ('<td class="checkbox"><input type="checkbox"></td>');
html.push ('<td class="star"><img src="img/calendar-16.png" /></td>');
html.push ('<td class="from"></td>');
html.push ('<td class="subject">',
d.escapeHTML (res.occurrences[0].summary.value),
+2 -3
View File
@@ -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 + '|');