From 3ad87a2ff4c91efc2a5a10e2574a20aff5c75492 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Fri, 3 Feb 2017 17:15:03 +0100
Subject: [PATCH] overview dialog is closing when link to map provided

---
 frontend-js/src/main/js/GuiConnector.js       | 12 ------------
 frontend-js/src/main/js/gui/OverviewDialog.js |  4 ++--
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/frontend-js/src/main/js/GuiConnector.js b/frontend-js/src/main/js/GuiConnector.js
index 7a6eb93c44..2f8d2132fd 100644
--- a/frontend-js/src/main/js/GuiConnector.js
+++ b/frontend-js/src/main/js/GuiConnector.js
@@ -170,14 +170,6 @@ GuiConnector.showSelectionMenu = function(x, y) {
   }
 };
 
-/**
- * Gets html div where overview images should be visualized.
- * 
- */
-GuiConnector.getOverviewHtmlTag = function() {
-  return document.getElementById(ServerConnector.formIdentifier + ':overviewDialog');
-};
-
 /**
  * Updates coordinates of the mouse in the browser.
  */
@@ -240,10 +232,6 @@ GuiConnector.getObjectByPrimefaceId = function(id) {
   return $(PrimeFaces.escapeClientId(id));
 };
 
-GuiConnector.getOverviewDialog = function() {
-  return _overviewDialog;
-};
-
 GuiConnector.alert = function(message) {
   logger.error(message);
   alert(message);
diff --git a/frontend-js/src/main/js/gui/OverviewDialog.js b/frontend-js/src/main/js/gui/OverviewDialog.js
index 20245945eb..785ba2a210 100644
--- a/frontend-js/src/main/js/gui/OverviewDialog.js
+++ b/frontend-js/src/main/js/gui/OverviewDialog.js
@@ -119,14 +119,14 @@ OverviewDialog.prototype.showOverview = function(overviewImageId) {
         // TODO min zoom value can be different for every map, it should be
         // changed in the future
         map.showModel(link.modelLinkId, link.latLng, link.zoomLevel + map.getMinZoom());
-        overviewDialog.hide();
+        $(self.getElement()).dialog("close");
       } else if (link.type === "OverviewImageLink") {
         logger.debug("Opening image from overview. ImageId: " + link.imageLinkId);
         self.showOverview(link.imageLinkId);
       } else if (link.type === "OverviewSearchLink") {
         logger.debug("Sending search query. Query: " + link.query);
         GuiConnector.search(link.query);
-        overviewDialog.hide();
+        $(self.getElement()).dialog("close");
       } else {
         logger.warn("Unknown type of link: " + link.type + ". Don't know what to do... LinkId: " + link.idObject);
       }
-- 
GitLab