rem: alarmlist.removeChild(widget); if (!alarmlist.hasChildNodes()) { 
add: widget.removeEventListener("itemdetails", onItemDetails, false); alarmRichlist.removeChild(widget);  if (!alarmRichlist.hasChildNodes()) { 
context: function removeWidgetFor(item) {    var hashId = item.hashId;    var alarmlist = document.getElementById("alarmlist");    var nodes = alarmlist.childNodes;    for (var i = nodes.length - 1; i >= 0; --i) {        var widget = nodes[i];        if (widget.item.hashId == hashId) {            widget.removeEventListener("snooze", onSnoozeAlarm, false);            widget.removeEventListener("dismiss", onDismissAlarm, false);            alarmlist.removeChild(widget);            if (!alarmlist.hasChildNodes()) {                // check again next round since this removeWidgetFor call may be                // followed by an addWidgetFor call (e.g. when refreshing), and                // we don't want to close and open the window in that case.                function closer() {                    if (!alarmlist.hasChildNodes()) {                        document.getElementById("calendar-alarmwindow").cancelDialog();                    }                }                setTimeout(closer, 0);            }            break;        }    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/14f01fb0c86c2a2ef4e2a1baaf2530baba8e4a91/calendar-alarm-dialog.js/clean/calendar/base/content/calendar-alarm-dialog.js