2012-10-18 20:55:41 +02:00
|
|
|
// This file doesn't have any local state or helper functions, so it has
|
|
|
|
// a simpler structure than the proper modules.
|
2012-10-03 20:49:58 +02:00
|
|
|
|
2012-10-18 20:55:41 +02:00
|
|
|
var rows = {
|
|
|
|
// We don't need an andSelf() here because we already know
|
|
|
|
// that our next element is *not* a message_row, so this
|
|
|
|
// isn't going to end up empty unless we're at the bottom or top.
|
|
|
|
next_visible: function (message_row) {
|
|
|
|
if (message_row === undefined)
|
|
|
|
return [];
|
|
|
|
var row = message_row.next('.message_row');
|
|
|
|
if (row.length !== 0) {
|
|
|
|
return row;
|
|
|
|
}
|
|
|
|
return message_row.nextUntil('.message_row').next('.message_row');
|
|
|
|
},
|
2012-10-03 20:49:58 +02:00
|
|
|
|
2012-10-18 20:55:41 +02:00
|
|
|
prev_visible: function (message_row) {
|
|
|
|
if (message_row === undefined)
|
|
|
|
return [];
|
|
|
|
var row = message_row.prev('.message_row');
|
|
|
|
if (row.length !== 0) {
|
|
|
|
return row;
|
|
|
|
}
|
|
|
|
return message_row.prevUntil('.message_row').prev('.message_row');
|
|
|
|
},
|
2012-10-03 20:49:58 +02:00
|
|
|
|
2012-10-18 20:55:41 +02:00
|
|
|
first_visible: function () {
|
|
|
|
return $('.focused_table .message_row:first');
|
|
|
|
},
|
2012-10-03 20:49:58 +02:00
|
|
|
|
2012-10-18 20:55:41 +02:00
|
|
|
last_visible: function () {
|
|
|
|
return $('.focused_table .message_row:last');
|
|
|
|
},
|
2012-10-03 20:49:58 +02:00
|
|
|
|
2012-10-18 20:55:41 +02:00
|
|
|
id: function (message_row) {
|
|
|
|
return message_row.attr('zid');
|
|
|
|
},
|
|
|
|
|
|
|
|
get: function (message_id, table_name) {
|
|
|
|
if (table_name === undefined)
|
|
|
|
table_name = (narrow.active() ? 'zfilt' : 'zhome');
|
|
|
|
return $('#' + table_name + message_id);
|
|
|
|
}
|
|
|
|
};
|