[FIX] web_editor: wrong focus detection in the editor

Issue detected with tests in the branch that replace deferred by native
Promise. Need to add isMedia to detect if the target is already a media
when focus the editor.

closes odoo/odoo#31632

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Gorash
2019-03-06 12:33:36 +00:00
parent 03a217e47e
commit e797d7a3c3
2 changed files with 2 additions and 2 deletions
@@ -86,7 +86,7 @@ var MediaPlugin = AbstractPlugin.extend({
* @param {Node} target
*/
update: function (target) {
if (!target) {
if (!target || !dom.isMedia(target)) {
return;
}
if (!this.options.displayPopover(target)) {
@@ -610,7 +610,7 @@ var Wysiwyg = Widget.extend({
this._editableHasFocus = true;
this._justFocused = true;
setTimeout(function () {
self._justFocused = true;
self._justFocused = false;
});
},
/**