From 04b8c3aa28a0cb2ee37651e23dbe5cd39ef7b7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 29 Nov 2018 17:05:50 +0100 Subject: [PATCH] forms: invalidate map area when field is shown on condition change (#28469) --- wcs/qommon/static/js/qommon.forms.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcs/qommon/static/js/qommon.forms.js b/wcs/qommon/static/js/qommon.forms.js index d8f1f06f9..1c1d326b7 100644 --- a/wcs/qommon/static/js/qommon.forms.js +++ b/wcs/qommon/static/js/qommon.forms.js @@ -87,7 +87,11 @@ $(function() { $.each(json.result, function(key, value) { var $widget = $('[data-field-id="' + key + '"]'); if (value.visible) { + var was_visible = $widget.is(':visible'); $widget.show(); + if ($widget.hasClass('MapWidget') && !was_visible) { + $widget.find('.qommon-map').trigger('qommon:invalidate'); + } } else { $widget.hide(); } -- 2.20.0.rc1