Browse Source

Fix state of subscription toggle on folders list after changing folder state from the search result (#7653)

pull/7798/head
Aleksander Machniak 5 years ago
parent
commit
93df53ee9e
  1. 2
      CHANGELOG
  2. 20
      program/js/app.js

2
CHANGELOG

@ -68,6 +68,8 @@ CHANGELOG Roundcube Webmail
- Fix so anchor tags without href attribute are not modified (#7413)
- Fix extra angle brackets in In-Reply-To header derived from mailto: params (#7655)
- Fix folder list issue whan special folder is a subfolder (#7647)
- Fix Elastic's folder subscription toggle in search result (#7653)
- Fix state of subscription toggle on folders list after changing folder state from the search result (#7653)
RELEASE 1.4.9
-------------

20
program/js/app.js

@ -7809,20 +7809,28 @@ function rcube_webmail()
this.subscribe = function(folder)
{
if (folder) {
var lock = this.display_message('foldersubscribing', 'loading');
this.http_post('subscribe', {_mbox: folder}, lock);
}
this.change_subscription_state(folder, true);
};
this.unsubscribe = function(folder)
{
this.change_subscription_state(folder, false);
};
this.change_subscription_state = function(folder, state)
{
if (folder) {
var lock = this.display_message('folderunsubscribing', 'loading');
this.http_post('unsubscribe', {_mbox: folder}, lock);
var prefix = state ? '' : 'un',
lock = this.display_message('folder' + prefix + 'subscribing', 'loading');
this.http_post(prefix + 'subscribe', {_mbox: folder}, lock);
// in case this was a list of search results, update also the main list
$(this.gui_objects.subscriptionlist).find('input[value="' + folder + '"]').prop('checked', state);
}
};
// when user select a folder in manager
this.show_folder = function(folder, path, force)
{

Loading…
Cancel
Save