diff options
author | Aleksander Machniak <machniak@kolabsys.com> | 2014-07-26 18:12:25 (GMT) |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2014-07-26 18:12:25 (GMT) |
commit | e095efae99f37dae7161f5d2440e538a4cba74f8 (patch) | |
tree | e5bacf91dc83cb8e48123e3e328b666e9beb5762 /plugins/kolab_files | |
parent | a5e09a0ea64dc2b9548787c1e34b34ef4a66f26f (diff) | |
download | roundcubemail-plugins-kolab-e095efae99f37dae7161f5d2440e538a4cba74f8.tar.gz |
Enable Print button if PDF viewer is loaded into an iframe
Diffstat (limited to 'plugins/kolab_files')
-rw-r--r-- | plugins/kolab_files/kolab_files.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js index c520395..a525c39 100644 --- a/plugins/kolab_files/kolab_files.js +++ b/plugins/kolab_files/kolab_files.js @@ -705,6 +705,13 @@ kolab_files_frame_load = function(frame) rcmail.enable_command('files-print', (rcmail.file_editor && rcmail.file_editor.printable) || (rcmail.env.file_data && /^image\//i.test(rcmail.env.file_data.type))); + + // detect Print button and check if it can be accessed + try { + if ($('#fileframe').contents().find('#print').length) + rcmail.enable_command('files-print', true); + } + catch(e) {}; }; @@ -866,6 +873,13 @@ rcube_webmail.prototype.files_print = function() win.print(); } } + else { + // e.g. Print button in PDF viewer + try { + $('#fileframe').contents().find('#print').click(); + } + catch(e) {}; + } }; rcube_webmail.prototype.files_set_quota = function(p) |