[FIX] correctly select range after inserting a link in the document

Apparently same issue as noted in
xmo@openerp.com-20130902105411-ni3klun0k8v1tmjg, RTE and bootstrap
modal fight for focus (oddly not in Firefox), leading to the callstack
blowing up (after a fraction of a second of browser freezing).

Use same remedy, defer focus-manipulating operation to after the
dialog has been removed and destroyed in order to avoid focus fight.

bzr revid: xmo@openerp.com-20130902105637-1y9aogm1yx9z81jt
This commit is contained in:
Xavier Morel
2013-09-02 12:56:37 +02:00
parent 2f97feb322
commit 9733c396fe
@@ -384,9 +384,12 @@
element: 'a',
attributes: attributes,
}).applyToRange(range);
// blows up the call stack, not sure why as original version
// seems to work OK
// range.select();
// focus dance between RTE & dialog blow up the stack in Safari
// and Chrome, so defer select() until dialog has been closed
setTimeout(function () {
range.select();
}, 0);
}
},
save: function () {