[IMP] design: add an icon behind external links

The external links' target attribute is now also updated to open the
link in a new tab. In addition, the "[source]" link of autodoc's models
is moved right next to the name of the model to correctly position the
icon.

task-2790244

closes odoo/documentation#2167

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Elisabeth Dickinson
2022-06-08 10:09:10 +00:00
committed by Antoine Vandevenne (anv)
parent c0040fa532
commit 343decf192
9 changed files with 25 additions and 2 deletions
+6 -1
View File
@@ -3,10 +3,15 @@
document.addEventListener('DOMContentLoaded', function () {
const content = document.getElementById('o_content');
// Enforce the presence of the `img-fluid` class on all images in the body
// Enforce the presence of the `img-fluid` class on all images in the body.
content.querySelectorAll('img').forEach(image => {
image.classList.add('img-fluid');
});
// Make all external links open in a new tab by default.
content.querySelectorAll('a.external').forEach(externalLink => {
externalLink.setAttribute('target', '_blank');
})
});
})();