norows: true,
onScrollIdle: settitle,
onSlide: settitle,
- onViewChange: function() {
- DimpCore.addGC(this.viewport.visibleRows());
- }.bind(this),
onContent: function(rows) {
var mf, search,
thread = ((this.viewport.getMetaData('sortby') == DIMP.conf.sortthread) && this.viewport.getMetaData('thread'));
}.bind(this),
onClearRows: function(r) {
r.each(function(row) {
- var c = $(row).down('DIV.msCheck');
- if (c) {
- DimpCore.addGC(c);
- }
if (row.id) {
this._removeMouseEvents(row);
}
}
DimpCore.DMenu.removeElement($(elt).identify());
- DimpCore.addGC(elt);
},
_onMenuShow: function(ctx)
deleteFolderElt: function(fid, sub)
{
var f = $(fid), submbox;
- DimpCore.addGC($(f, fid + '_div', fid + '_label'));
if (sub) {
submbox = $(this.getSubFolderId(fid));
if (submbox) {
}
[ DragDrop.Drags.get_drag(fid), DragDrop.Drops.get_drop(fid) ].compact().invoke('destroy');
this._removeMouseEvents(f);
- DimpCore.addGC(f);
if (this.viewport) {
this.viewport.deleteView(fid);
}
// Vars used and defaulting to null/false:
// DMenu, alertrequest, inAjaxCallback, is_logout, onDoActionComplete,
// window_load
- remove_gc: [],
server_error: 0,
buttons: [ 'button_reply', 'button_forward', 'button_spam', 'button_ham', 'button_deleted' ],
var elt = $(effect.element),
parent = elt.up();
- this.addGC(elt.remove());
+ elt.remove();
if (!parent.childElements().size() &&
parent.readAttribute('id') == 'ie6alertsfix') {
- this.addGC(parent.remove());
+ parent.remove();
}
} catch (e) {
this.debug('removeAlert', e);
}
},
- /* elt = DOM element */
- removeMouseEvents: function(elt)
- {
- this.DMenu.removeElement($(elt).identify());
- this.addGC(elt);
- },
-
/* Add a popdown menu to a dimpactions button. */
addPopdown: function(bid, ctx)
{
if (cnt > 15) {
tmp = $('largeaddrspan').cloneNode(true);
+ tmp.writeAttribute('id', 'largeaddrspan_active');
elt.insert(tmp);
base = tmp.down('.dispaddrlist');
- tmp = tmp.down();
- this.clickObserveHandler({ d: tmp, f: function(d) { [ d.down(), d.down(1), d.next() ].invoke('toggle'); }.curry(tmp) });
- tmp = tmp.down();
+ tmp = tmp.down(1);
tmp.setText(tmp.getText().replace('%d', cnt));
} else {
base = elt;
/* Removes event handlers from address links. */
removeAddressLinks: function(id)
{
- [ id.select('.address'), id.select('.largeaddrtoggle') ].flatten().compact().each(this.removeMouseEvents.bind(this));
- },
-
- /* Utility functions. */
- addGC: function(elt)
- {
- this.remove_gc = this.remove_gc.concat(elt);
+ id.select('.address').each(function(elt) {
+ this.DMenu.removeElement(elt.identify());
+ }, this);
},
addURLParam: function(url, params)
case 'alerts':
this.alertsFade(elt);
break;
+
+ case 'largeaddrspan_active':
+ tmp = elt.down();
+ [ tmp.down(), tmp.down(1), tmp.next() ].invoke('toggle');
+ break;
}
elt = elt.up();
DimpCore.buttons = DimpCore.buttons.without('button_ham');
}
- /* Init garbage collection function - runs every 10 seconds. */
- new PeriodicalExecuter(function() {
- if (DimpCore.remove_gc.size()) {
- try {
- $A(DimpCore.remove_gc.splice(0, 75)).compact().invoke('stopObserving');
- } catch (e) {
- DimpCore.debug('remove_gc[].stopObserving', e);
- }
- }
- }, 10);
-
/* Add click handler. */
document.observe('click', DimpCore._clickHandler.bindAsEventListener(DimpCore));
});