Enable content frame navigation for Settings > Folders

pull/5742/merge
Aleksander Machniak 7 years ago
parent 003bec2ccb
commit 852e931c5d

@ -357,7 +357,7 @@ ul.treelist li {
}
&.root {
display: none;
display: none !important;
/* FIXME: This element is confusing, I propose to not use it */
}
}

@ -597,7 +597,8 @@ function rcube_elastic_ui()
function content_frame_navigation(href, event)
{
// Don't display navigation for create/add action frames
if (href.match(/_action=(create|add)/)) {
// TODO: edit-folder should really be create-folder
if (href.match(/_action=(create|add)/) || (href.match(/_action=edit-folder/) && href.match(/_mbox=&/))) {
if (env.frame_nav) {
$(env.frame_nav).addClass('hidden');
}
@ -605,21 +606,24 @@ function rcube_elastic_ui()
return;
}
var uid, list = $('[data-list]', layout.list).data('list');
var uid, list, _list = $('[data-list]', layout.list).data('list');
if (!list || !(list = rcmail[list]) || !list.get_single_selection) {
if (!_list || !(list = rcmail[_list])) {
return;
}
// expand collapsed row so we do not skip the whole thread
// TODO: Unified interface for list and treelist widgets
if (uid = list.get_single_selection()) {
if (list.rows[uid] && !list.rows[uid].expanded) {
if (list.rows && list.rows[uid] && !list.rows[uid].expanded) {
list.expand_row(event, uid);
}
else if (list.get_node && list.get_node(uid).collapsed) {
list.expand(uid);
}
}
// TODO: Add "message X from Y" text between buttons
// TODO: Support tree_list widget (Settings > Folders)
// TODO: Add "message X of Y" text between buttons
if (!env.frame_nav) {
env.frame_nav = $('<div class="footer toolbar content-frame-navigation">')
@ -634,12 +638,12 @@ function rcube_elastic_ui()
prev_button = $('a.button.prev', env.frame_nav).off('click').addClass('disabled'),
span = $('span', env.frame_nav).text('');
if ((next = list.get_next_row()) || rcmail.env.current_page < rcmail.env.pagecount) {
if ((next = list.get_next()) || rcmail.env.current_page < rcmail.env.pagecount) {
found = true;
next_button.removeClass('disabled').on('click', function() {
env.content_lock = true;
if (next) {
list.select(next.uid);
list.select(next);
}
else {
rcmail.env.list_uid = 'FIRST';
@ -648,12 +652,12 @@ function rcube_elastic_ui()
});
}
if ((prev = list.get_prev_row()) || rcmail.env.current_page > 1) {
if (((prev = list.get_prev()) && (prev != '*' || _list != 'subscription_list')) || rcmail.env.current_page > 1) {
found = true;
prev_button.removeClass('disabled').on('click', function() {
env.content_lock = true;
if (prev) {
list.select(prev.uid);
list.select(prev);
}
else {
rcmail.env.list_uid = 'LAST';

Loading…
Cancel
Save