Fix thread/list mode update and display

pull/193/head
Thomas Bruederli 11 years ago
parent 9202e93b75
commit 1d6082c5e2

@ -332,6 +332,10 @@ class rcube_imap extends rcube_storage
$this->search_sort_field = $set[3]; $this->search_sort_field = $set[3];
$this->search_sorted = $set[4]; $this->search_sorted = $set[4];
$this->search_threads = is_a($this->search_set, 'rcube_result_thread'); $this->search_threads = is_a($this->search_set, 'rcube_result_thread');
if (is_a($this->search_set, 'rcube_result_multifolder')) {
$this->set_threading(false);
}
} }

@ -181,6 +181,7 @@ else {
// update message count display // update message count display
$OUTPUT->set_env('search_request', $search_str ? $search_request : ''); $OUTPUT->set_env('search_request', $search_str ? $search_request : '');
$OUTPUT->set_env('threading', $RCMAIL->storage->get_threading());
$OUTPUT->set_env('messagecount', $count); $OUTPUT->set_env('messagecount', $count);
$OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->storage->get_pagesize())); $OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->storage->get_pagesize()));
$OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS')); $OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));

@ -139,7 +139,8 @@ function rcube_mail_ui()
if (rcmail.env.task == 'mail') { if (rcmail.env.task == 'mail') {
rcmail.addEventListener('menu-open', menu_open) rcmail.addEventListener('menu-open', menu_open)
.addEventListener('menu-save', menu_save) .addEventListener('menu-save', menu_save)
.addEventListener('responseafterlist', function(e){ switch_view_mode(rcmail.env.threading ? 'thread' : 'list') }); .addEventListener('responseafterlist', function(e){ switch_view_mode(rcmail.env.threading ? 'thread' : 'list', true) })
.addEventListener('responseaftersearch', function(e){ switch_view_mode(rcmail.env.threading ? 'thread' : 'list', true) });
var dragmenu = $('#dragmessagemenu'); var dragmenu = $('#dragmessagemenu');
if (dragmenu.length) { if (dragmenu.length) {
@ -730,9 +731,9 @@ function rcube_mail_ui()
/** /**
* *
*/ */
function switch_view_mode(mode) function switch_view_mode(mode, force)
{ {
if (!$('#mail'+mode+'mode').hasClass('disabled')) { if (force || !$('#mail'+mode+'mode').hasClass('disabled')) {
$('#maillistmode, #mailthreadmode').removeClass('selected'); $('#maillistmode, #mailthreadmode').removeClass('selected');
$('#mail'+mode+'mode').addClass('selected'); $('#mail'+mode+'mode').addClass('selected');
} }

Loading…
Cancel
Save