- Fixed possible js error occurance (#1487872)

release-0.6
alecpl 13 years ago
parent e5e1eb0195
commit 5b67d35b59

@ -4854,17 +4854,18 @@ function rcube_webmail()
// and for setting some message list global variables // and for setting some message list global variables
this.set_message_coltypes = function(coltypes, repl) this.set_message_coltypes = function(coltypes, repl)
{ {
this.env.coltypes = coltypes; var list = this.message_list,
thead = list ? list.list.tHead : null,
cell, col, n, len, th, tr;
// set correct list titles this.env.coltypes = coltypes;
var thead = this.gui_objects.messagelist ? this.gui_objects.messagelist.tHead : null,
cell, col, n, len;
// replace old column headers // replace old column headers
if (thead) { if (thead) {
if (repl) { if (repl) {
var th = document.createElement('thead'), th = document.createElement('thead');
tr = document.createElement('tr'); tr = document.createElement('tr');
for (c=0, len=repl.length; c < len; c++) { for (c=0, len=repl.length; c < len; c++) {
cell = document.createElement('td'); cell = document.createElement('td');
cell.innerHTML = repl[c].html; cell.innerHTML = repl[c].html;
@ -4898,15 +4899,16 @@ function rcube_webmail()
if ((n = $.inArray('subject', this.env.coltypes)) >= 0) { if ((n = $.inArray('subject', this.env.coltypes)) >= 0) {
this.set_env('subject_col', n); this.set_env('subject_col', n);
if (this.message_list) if (list)
this.message_list.subject_col = n; list.subject_col = n;
} }
if ((n = $.inArray('flag', this.env.coltypes)) >= 0) if ((n = $.inArray('flag', this.env.coltypes)) >= 0)
this.set_env('flagged_col', n); this.set_env('flagged_col', n);
if ((n = $.inArray('status', this.env.coltypes)) >= 0) if ((n = $.inArray('status', this.env.coltypes)) >= 0)
this.set_env('status_col', n); this.set_env('status_col', n);
this.message_list.init_header(); if (list)
list.init_header();
}; };
// replace content of row count display // replace content of row count display

Loading…
Cancel
Save