diff --git a/navalplanner-webapp/src/main/resources/web/js/common/components/ChromePDFBugFix.js b/navalplanner-webapp/src/main/resources/web/js/common/components/ChromePDFBugFix.js new file mode 100644 index 000000000..c1b70dd79 --- /dev/null +++ b/navalplanner-webapp/src/main/resources/web/js/common/components/ChromePDFBugFix.js @@ -0,0 +1,24 @@ +/* + * This function is a temporary fix + * for a bug with chrome. + * + * bug-url: http://code.google.com/p/chromium/issues/detail?id=65395 + * + * bug-description: chrome PDF Viewer plugin shrinks PDF and entire surrounding page + * when including a pdf inside an iframe + * + * bug-notes: this bug seems to be fixed since version 9.0.597.84 + * but we should keep this fix for a while to support people with + * older versions + * + * */ +zk.afterLoad(function(){ + old = zAu.cmd0.download; + zAu.cmd0.download = function(url){ + if( ! url.match(/\.pdf$/) ){ + return old.apply(url); + } + + window.open(url, "Report"); + }; +}); \ No newline at end of file diff --git a/navalplanner-webapp/src/main/resources/web/js/common/components/zk.wpd b/navalplanner-webapp/src/main/resources/web/js/common/components/zk.wpd index 995cff3f3..63e2dd90b 100644 --- a/navalplanner-webapp/src/main/resources/web/js/common/components/zk.wpd +++ b/navalplanner-webapp/src/main/resources/web/js/common/components/zk.wpd @@ -1,3 +1,4 @@ +