diff options
| author | Mohammed Shekha <msh@openerp.com> | 2018-10-11 13:34:12 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-10-19 09:07:24 +0000 |
| commit | 10cf85e4c5db18be1dd2a48cddc336356f12d33d (patch) | |
| tree | e2aa4b9aaea5ec2fe9b2286d6944f28335389b73 /addons/mail/static/src/js/thread_widget.js | |
| parent | 892996049232b02dcd456ce7b185dc1f252826e2 (diff) | |
[FIX] mail: ignore popover if bootstrap not available
Before this commit, there may be a silent crash when accessing the
livechat from the customer URL, e.g.
`http://mycompany.odoo.com/im_livechat/support/1`.
This issue occurs when bootstrap popover lib is not available.
This does not occur if one tab of the current browser has this lib
loaded. To reproduce this issue, open the customer URL from another
browser:
1. Access to `/web` from any browser (e.g. Chrome)
2. Go to Live Chat app
3. Select a livechat channel
4. Go to sheet page "Widget"
5. Copy text of the customer URL (2nd "Copy Text")
6. Paste the URL in a different browser (e.g. Firefox)
7. Open the livechat menu
8. Inspect dev tools
=> It will complain that `popover` is not a function.
We would like to keep the livechat lib as small as possible,
so instead of importing the boostrap lib, we simply prevent
the logic that generates the issue.
Task-ID 1885445
Diffstat (limited to 'addons/mail/static/src/js/thread_widget.js')
| -rw-r--r-- | addons/mail/static/src/js/thread_widget.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/thread_widget.js b/addons/mail/static/src/js/thread_widget.js index 10ecb5d2824..aff6b27bfdd 100644 --- a/addons/mail/static/src/js/thread_widget.js +++ b/addons/mail/static/src/js/thread_widget.js @@ -446,6 +446,9 @@ var ThreadWidget = Widget.extend({ if (this._messageMailPopover) { this._messageMailPopover.popover('hide'); } + if (!this.$('.o_thread_tooltip').length) { + return; + } this._messageMailPopover = this.$('.o_thread_tooltip').popover({ html: true, boundary: 'viewport', |
