[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
This commit is contained in:
Mohammed Shekha
2018-10-19 09:07:24 +00:00
committed by Alexandre Kühn
parent 8929960492
commit 10cf85e4c5
@@ -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',