[FIX] web: fix low perf. of web_tour when a modal is opened

When a modal was opened, the system seemed slower because a web_tour
callback was called every 500 ms.

This was because of jQuery. Using the "find" method on a jQuery element
will temporary set an ID on this element for some jQuery reason. So,
when a modal opened, a DOM mutation was caught by the web_tour observer
which then called the "update" method in which a $modal.find
is done... and so an ID was set and a new DOM mutation was caught again.

The solution here is to provide an unique ID on each modal in odoo so
that the find function has not to set an ID, and so does not trigger
any DOM mutation.
This commit is contained in:
qsm-odoo
2016-09-16 16:43:19 +02:00
parent 5b796318b4
commit f98aa664df
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- These templates are accessible in backend and frontend -->
<div t-name="Dialog" class="modal" tabindex="-1" data-backdrop="static" role="dialog" aria-hidden="true">
<div t-name="Dialog" class="modal" tabindex="-1" data-backdrop="static" role="dialog" aria-hidden="true" t-att-id="_.uniqueId('modal_')">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">