summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-03-26 19:16:03 +0100
committerAleksander Machniak <alec@alec.pl>2013-03-26 19:16:03 +0100
commit723f4e63aa2e60e0ef72cdfb506299512a9c3405 (patch)
tree48cfa43662331e5e209db385c46b179c80f02871 /program/js
parent3ca58cd22cae4cbc07479792f4ff4258aad785af (diff)
Refresh current folder in opener window after draft save or message sent (#1488997)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js
index b2a6a0409..758e4b893 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3302,6 +3302,14 @@ function rcube_webmail()
this.set_draft_id = function(id)
{
+ var rc;
+
+ if (!this.env.draft_id && id && (rc = this.opener())) {
+ // refresh the drafts folder in opener window
+ if (rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == this.env.drafts_mailbox)
+ rc.command('checkmail');
+ }
+
this.env.draft_id = id;
$("input[name='_draft_saveid']").val(id);
};
@@ -3678,15 +3686,19 @@ function rcube_webmail()
this.env.search_id = null;
};
- this.sent_successfully = function(type, msg)
+ this.sent_successfully = function(type, msg, target)
{
this.display_message(msg, type);
if (this.env.extwin) {
- var opener_rc = this.opener();
+ var rc = this.opener();
this.lock_form(this.gui_objects.messageform);
- if (opener_rc)
- opener_rc.display_message(msg, type);
+ if (rc) {
+ rc.display_message(msg, type);
+ // refresh the folder where sent message was saved
+ if (target && rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == target)
+ rc.command('checkmail');
+ }
setTimeout(function(){ window.close() }, 1000);
}
else {