From b5962dd57f36149b30c377478e839ab42253ce2d Mon Sep 17 00:00:00 2001 From: wthrajat Date: Thu, 3 Aug 2023 22:39:54 +0530 Subject: [PATCH] [Misc] Updated the method to call init() using newer XWiki API --- .../src/main/resources/Maps/Code/MapSheet.xml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/application-interactive-maps-ui/src/main/resources/Maps/Code/MapSheet.xml b/application-interactive-maps-ui/src/main/resources/Maps/Code/MapSheet.xml index 8404bc6..3ec348f 100644 --- a/application-interactive-maps-ui/src/main/resources/Maps/Code/MapSheet.xml +++ b/application-interactive-maps-ui/src/main/resources/Maps/Code/MapSheet.xml @@ -191,7 +191,7 @@ //Make sure to include Maps.Code.LeafletUtils before using this require(['jquery', 'leaflet', 'leaflet-commons', 'leaflet-indoor', 'bootstrap'], function ($, leaflet, leafletCommons) { 'use strict'; - function init() + var init = function () { var map; @@ -459,13 +459,9 @@ require(['jquery', 'leaflet', 'leaflet-commons', 'leaflet-indoor', 'bootstrap'], $('.map-search-filter').removeClass('open'); leafletCommons.updateURLWithMapState(); }); - + $(init).on('xwiki:dom:updated', init); } - //Run the init() function when dom is loaded or updated - (XWiki && XWiki.domIsLoaded && init()) || document.observe("xwiki:dom:loaded", init); - (XWiki && XWiki.domIsUpdated && init()) || document.observe("xwiki:dom:updated", init); - });