[FIX] mail: prevent attachmentViewer crash when clicking a video

In the last refactoring*, the click event handler from the old code
was missed, calling an undefined function, which can cause a crash
on some browsers.

This commit fixes this issue and implements the expected behavior of
preventing the propagation of the click to the parent handler that
closes the attachmentViewer.

\* https://github.com/odoo/odoo/pull/110188

closes odoo/odoo#117288

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
This commit is contained in:
Thanh Dodeur
2023-03-31 08:51:05 +02:00
parent efb5564fd5
commit 560243aefa
@@ -36,7 +36,7 @@
<iframe t-if="state.attachment.isPdf" class="o-mail-AttachmentViewer-view w-75 h-100 border-0" t-ref="iframeViewerPdf" t-att-class="{ 'w-100': env.isSmall }" t-att-src="state.attachment.defaultSource"/>
<iframe t-if="state.attachment.isText" class="o-mail-AttachmentViewer-view o-isText o_text w-75 h-100 border-0" t-att-src="state.attachment.defaultSource"/>
<iframe t-if="state.attachment.isUrlYoutube" allow="autoplay; encrypted-media" class="o-mail-AttachmentViewer-view w-75 h-100 border-0" t-att-src="state.attachment.defaultSource" height="315" width="560"/>
<video t-if="state.attachment.isVideo" class="o-mail-AttachmentViewer-view w-75 h-75" t-att-class="{ 'w-100 h-100': env.isSmall }" t-on-click="onClickVideo" controls="controls">
<video t-if="state.attachment.isVideo" class="o-mail-AttachmentViewer-view w-75 h-75" t-att-class="{ 'w-100 h-100': env.isSmall }" t-on-click.stop="" controls="controls">
<source t-att-data-type="state.attachment.mimetype" t-att-src="state.attachment.defaultSource"/>
</video>
</div>