diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-06-25 08:58:23 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-06-25 08:58:23 +0200 |
commit | 2b3a3b1407bf2f6a7019f921a177d99506e3b76c (patch) | |
tree | d8ebe415bef86c4448de220ce9c60a0fe80fc25f /program/js/app.js | |
parent | 855c85377d44943ba307d083632c6c5a9f1c98ad (diff) | |
parent | 093a3d9e7df58e2bd41db2caf6a348bf60c9ec8a (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/program/js/app.js b/program/js/app.js index e654a1481..c6b6d39f1 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -277,6 +277,8 @@ function rcube_webmail() // init message compose form this.init_messageform(); } + else if (this.env.action == 'get') + this.enable_command('download', 'print', true); // show printing dialog else if (this.env.action == 'print' && this.env.uid) { if (bw.safari) @@ -864,7 +866,7 @@ function rcube_webmail() // open attachment in frame if it's of a supported mimetype if (command != 'download-attachment' && mimetype && this.env.mimetypes && $.inArray(mimetype, this.env.mimetypes) >= 0) { - if (this.open_window(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', true, true)) + if (this.open_window(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1')) break; } @@ -1048,7 +1050,10 @@ function rcube_webmail() break; case 'print': - if (uid = this.get_single_uid()) { + if (this.env.action == 'get') { + this.gui_objects.messagepartframe.contentWindow.print(); + } + else if (uid = this.get_single_uid()) { ref.printwin = this.open_window(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''), true, true); if (this.printwin) { if (this.env.action != 'show') @@ -1063,7 +1068,10 @@ function rcube_webmail() break; case 'download': - if (uid = this.get_single_uid()) + if (this.env.action == 'get') { + location.href = location.href.replace(/_frame=/, '_download='); + } + else if (uid = this.get_single_uid()) this.goto_url('viewsource', { _uid: uid, _mbox: this.env.mailbox, _save: 1 }); break; |