summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhruv Patel <dhp@odoo.com>2020-03-12 07:25:30 +0000
committerMohammed Shekha <msh@odoo.com>2020-03-16 13:17:00 +0000
commit2d5dd1448fcb86b5977ac10bf672698a065d18b9 (patch)
tree3261aa2224f161bbd23b358af077c36235273a62
parente00ce93a77fb71b49bd505eb0d883bbcb98b584f (diff)
[FIX] web: restrict to open sidebar forcefully in pdf viewer initially
Before this commit, when PDF viewer opens, it opens the sidebar forcefully. Now with this commit, we have restricted to open the sidebar on initial load by passing the false value to the forceOpen flag, we did this changes directly in the library file itself as the file loads in iframe so we can not change the file from outside by overriding the existing function or parameter. task-2209742 closes odoo/odoo#47458 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
-rw-r--r--addons/web/static/lib/pdfjs/web/viewer.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/lib/pdfjs/web/viewer.js b/addons/web/static/lib/pdfjs/web/viewer.js
index 5a5ecf79b99..54f95117ab9 100644
--- a/addons/web/static/lib/pdfjs/web/viewer.js
+++ b/addons/web/static/lib/pdfjs/web/viewer.js
@@ -5077,7 +5077,10 @@ function () {
return;
}
- if (!this._switchView(view, true)) {
+ // Odoo: This change is needed here as we can't change this parameter in an iframe.
+ // pass forceOpen argument to false to restrict opening of sidebar forcefully when
+ // pdf viewer opens initially.
+ if (!this._switchView(view, false)) {
this._dispatchEvent();
}
}