From b8d2557fe2e6c08b0c52e881e1974745e516a53a Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Fri, 14 Apr 2017 14:58:52 +0200
Subject: [PATCH] fix on opening comment dialog

---
 frontend-js/src/main/js/gui/CommentDialog.js      |  1 +
 frontend-js/src/main/js/gui/ContextMenu.js        |  1 -
 frontend-js/src/test/js/gui/CommentDialog-test.js | 14 ++++++++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/frontend-js/src/main/js/gui/CommentDialog.js b/frontend-js/src/main/js/gui/CommentDialog.js
index cbc0c3a0b1..fc433cc411 100644
--- a/frontend-js/src/main/js/gui/CommentDialog.js
+++ b/frontend-js/src/main/js/gui/CommentDialog.js
@@ -52,6 +52,7 @@ CommentDialog.prototype.open = function(types) {
   }
   return Promise.all(promises).then(function(elements) {
     self.setTypes(elements);
+    $(self.getElement()).dialog("open");
   });
 };
 CommentDialog.prototype._createGui = function(types) {
diff --git a/frontend-js/src/main/js/gui/ContextMenu.js b/frontend-js/src/main/js/gui/ContextMenu.js
index 2d0b526554..22e3bf731e 100644
--- a/frontend-js/src/main/js/gui/ContextMenu.js
+++ b/frontend-js/src/main/js/gui/ContextMenu.js
@@ -40,7 +40,6 @@ ContextMenu.prototype.addOption = function(name, handler) {
 };
 
 ContextMenu.prototype.open = function(x, y) {
-  logger.debug("open: " + x + ", " + y);
   var self = this;
   var $menu = $(self.getElement()).show().css({
     position : "absolute",
diff --git a/frontend-js/src/test/js/gui/CommentDialog-test.js b/frontend-js/src/test/js/gui/CommentDialog-test.js
index 8952c66fc3..a8272ddf97 100644
--- a/frontend-js/src/test/js/gui/CommentDialog-test.js
+++ b/frontend-js/src/test/js/gui/CommentDialog-test.js
@@ -39,4 +39,18 @@ describe('CommentDialog', function() {
     assert.ok(dialog.getName() !== undefined);
     dialog.destroy();
   });
+  
+  it('open', function() {
+    var map = helper.createCustomMap();
+    var dialog = new CommentDialog({
+      element : testDiv,
+      customMap : map
+    });
+    return dialog.open([]).then(function(){
+      assert.ok($(testDiv).dialog('isOpen'));      
+      dialog.destroy();
+    });
+  });
+  
+ 
 });
-- 
GitLab