From 9a4da8894fdb7b51e01fa05a3911ccf57b143563 Mon Sep 17 00:00:00 2001 From: jbm-odoo Date: Thu, 6 Feb 2020 12:24:14 +0000 Subject: [FIX] web: Avoid open too fast zoom Picture of employees are maximazed directly which is annoying when you move the mouse in kanban view. Add the ability to put a waiting time before opening the zoom in option of the field in the view (default value is 0). closes odoo/odoo#45229 Taskid: 2191289 X-original-commit: a264b17d8fe18464df439d896ecb7dea106caa5a Signed-off-by: jbm-odoo --- addons/web/static/src/js/fields/basic_fields.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 4aac42db13b..14e2cf3d37f 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1917,6 +1917,10 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ } else { $img = this.$('img'); } + var zoomDelay = 0; + if (this.nodeOptions.zoom_delay) { + zoomDelay = this.nodeOptions.zoom_delay; + } if(this.recordData[imageField]) { $img.attr('data-zoom', 1); @@ -1924,6 +1928,7 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ $img.zoomOdoo({ event: 'mouseenter', + timer: zoomDelay, attach: '.o_content', attachToTarget: true, onShow: function () { -- cgit v1.2.3