Skip to content

Commit

Permalink
[FIX] web: copy traceback in firefox
Browse files Browse the repository at this point in the history
Same issue as in 902e484. In some browser (eg. firefox) the container
parameter of ClipboardJS is needed if the focus is inside the modal so
the copy work.

See information on:
zenorocha/clipboard.js#368

opw-1902040
closes odoo#28117
  • Loading branch information
nle-odoo committed Oct 24, 2018
1 parent 0530b36 commit eeda38f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/web/static/src/js/services/crash_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ var CrashManager = core.Class.extend({
clipboard = new window.ClipboardJS($clipboardBtn[0], {
text: function () {
return (_t("Error") + ":\n" + error.message + "\n\n" + error.data.debug).trim();
}
},
// Container added because of Bootstrap modal that give the focus to another element.
// We need to give to correct focus to ClipboardJS (see in ClipboardJS doc)
// https://github.com/zenorocha/clipboard.js/issues/155
container: dialog.el,
});
clipboard.on("success", function (e) {
_.defer(function () {
Expand Down

0 comments on commit eeda38f

Please sign in to comment.