case 1:
curr_row = sel.get('dataob').first();
- curr = curr_row.rownum + num;
+ curr = curr_row.VP_rownum + num;
break;
default:
if (row.size()) {
row_data = row.get('dataob').first();
if (!curr_row || row_data.imapuid != curr_row.imapuid) {
- this.viewport.scrollTo(row_data.rownum);
+ this.viewport.scrollTo(row_data.VP_rownum);
this.viewport.select(row, { delay: 0.3 });
}
} else {
}
r.status += ptr.elt;
- r.bg.push(ptr.c);
+ r.VP_bg.push(ptr.c);
if (ptr.b) {
bg = ptr.b;
r.subject = r.subjecttitle = '[' + DIMP.text.badsubject + ']';
}
- r.bg.push('vpRow');
+ r.VP_bg.push('vpRow');
switch (mode) {
case 'vert':
- r.bg.unshift('vpRowVert');
- r.className = r.bg.join(' ');
+ r.VP_bg.unshift('vpRowVert');
+ r.className = r.VP_bg.join(' ');
return this.template.vert.evaluate(r);
default:
- r.bg.unshift('vpRowHoriz');
- r.className = r.bg.join(' ');
+ r.VP_bg.unshift('vpRowHoriz');
+ r.className = r.VP_bg.join(' ');
return this.template.horiz.evaluate(r);
}
}.bind(this),
e.memo.each(function(row) {
// Add context menu
- this._addMouseEvents({ id: row.domid, type: row.menutype });
- new Drag(row.domid, this._msgDragConfig);
+ this._addMouseEvents({ id: row.VP_domid, type: row.menutype });
+ new Drag(row.VP_domid, this._msgDragConfig);
}, this);
if (this.uid) {
case Event.KEY_BACKSPACE:
r = sel.get('dataob');
if (e.shiftKey) {
- this.moveSelected((r.last().rownum == this.viewport.getMetaData('total_rows')) ? (r.first().rownum - 1) : (r.last().rownum + 1), true);
+ this.moveSelected((r.last().rownum == this.viewport.getMetaData('total_rows')) ? (r.first().VP_rownum - 1) : (r.last().VP_rownum + 1), true);
}
this.deleteMsg({ vs: sel });
e.stop();
row = this.viewport.createSelection('rownum', this.lastrow + ((kc == Event.KEY_UP) ? -1 : 1));
if (row.size()) {
row = row.get('dataob').first();
- this.viewport.scrollTo(row.rownum);
- this.msgSelect(row.domid, { shift: true });
+ this.viewport.scrollTo(row.VP_rownum);
+ this.msgSelect(row.VP_domid, { shift: true });
}
} else {
this.moveSelected(kc == Event.KEY_UP ? -1 : 1);
});
});
- search = this.viewport.getSelection().search({ vp_id: { equal: uids } });
+ search = this.viewport.getSelection().search({ VP_id: { equal: uids } });
} else {
r.uids = r.uids[this.folder];
r.uids.each(function(f, u) {
* This function MUST return the HTML representation of the row.
*
* This representation MUST include both the DOM ID (stored in
- * the domid field) and the CSS class name (stored as an array in
- * the bg field) in the outermost element.
+ * the VP_domid data entry) and the CSS class name (stored as an
+ * array in the VP_bg data entry) in the outermost element.
*
* Selected rows will contain the classname 'vpRowSelected'.
*
* data: (object) Data for each entry that is passed to the template to create
* the viewable rows. Keys are a unique ID (see also the 'rowlist'
* entry). Values are the data objects. Internal keys for these data
- * objects must NOT begin with the string 'vp'.
+ * objects must NOT begin with the string 'VP_'.
* label: (string) [REQUIRED when initial is true] The label to use for the
* view.
* metadata [optional]: (object) Metadata for the view. Entries in buffer are
* view: (string) The view ID of the request.
*
*
+ * Data entries:
+ * -------------
+ * In addition to the data provided from the server, the following
+ * dynamically created entries are also available:
+ * VP_domid: (string) The DOM ID of the row.
+ * VP_id: (string) The unique ID used to store the data entry.
+ * VP_rownum: (integer) The row number of the row.
+ *
+ *
* Scroll bars use ars styled using these CSS class names:
* -------------------------------------------------------
* vpScroll - The scroll bar container.
{
var r = Object.clone(row);
- r.bg = r.bg
- ? row.bg.clone()
+ r.VP_bg = this.getSelected().contains('uid', r.VP_id)
+ ? [ 'vpRowSelected' ]
: [];
- if (this.getSelected().contains('uid', r.vp_id)) {
- r.bg.push('vpRowSelected');
- }
-
return this.opts.onContent(r, this.pane_mode);
},
updateRow: function(row)
{
- var d = $(row.domid);
+ var d = $(row.VP_domid);
if (d) {
this.opts.container.fire('ViewPort:clear', [ d ]);
this.opts.container.fire('ViewPort:contentComplete', [ row ]);
}
-
},
_handleWait: function(call)
if (!this.split_pane[mode].lh) {
// To avoid hardcoding the line height, create a temporary row to
// figure out what the CSS says.
- var d = new Element('DIV', { className: this.opts.list_class }).insert(this.prepareRow({ domid: null }, mode)).hide();
+ var d = new Element('DIV', { className: this.opts.list_class }).insert(this.prepareRow({ VP_domid: null }, mode)).hide();
$(document.body).insert(d);
this.split_pane[mode].lh = d.getHeight();
d.remove();
if (!Object.isUndefined(e)) {
// We can directly write the rownum to the original object
// since we will always rewrite when creating rows.
- e.domid = 'vp_row' + u;
- e.rownum = this.uidlist.get(u);
- e.vp_id = u;
+ e.VP_domid = 'VP_row' + u;
+ e.VP_rownum = this.uidlist.get(u);
+ e.VP_id = u;
return e;
}
}, this).compact();
{
d = Object.isArray(d) ? d : [ d ];
+ // Data is stored internally as UIDs.
switch (format) {
case 'dataob':
- return d.pluck('vp_id');
+ return d.pluck('VP_id');
case 'div':
+ // ID here is the DOM ID of the element object.
return d.pluck('id').invoke('substring', 6);
case 'domid':
return d;
case 'div':
- return d.pluck('domid').collect(function(e) { return $(e); }).compact();
+ return d.pluck('VP_domid').collect(function(e) { return $(e); }).compact();
case 'domid':
- return d.pluck('domid');
+ return d.pluck('VP_domid');
case 'rownum':
- return d.pluck('rownum');
+ return d.pluck('VP_rownum');
}
},
}
});
});
- }).pluck('vp_id'));
+ }).pluck('VP_id'));
},
size: function()