diff --git a/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js b/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js index c2d97a382de1e6442537821301fc4eb7f49f6bbd..2cc077f69fd8abf2e46f9c7ff7f9b4576981d163 100644 --- a/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js +++ b/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js @@ -46,13 +46,14 @@ SubmapPanel.prototype.createRow = function(model) { var openTd = document.createElement("td"); if (model.getId() !== self.getMap().getId()) { - var button = document.createElement("button"); var img = guiUtils.createIcon("icons/search.png"); - button.appendChild(img); - button.onclick = function() { + var link = document.createElement("a"); + link.href = "#"; + link.onclick = function() { self.getMap().openSubmap(model.getId()); }; - openTd.appendChild(button); + link.appendChild(img); + openTd.appendChild(link); } result.appendChild(openTd); @@ -69,9 +70,11 @@ SubmapPanel.prototype.createTableHeader = function() { nameTd.innerHTML = "Name"; row.appendChild(nameTd); - var viewTd = document.createElement("th"); - viewTd.innerHTML = "View"; - row.appendChild(viewTd); + row.appendChild(Functions.createElement({ + type : "th", + style : "width: 60px;", + content : "View" + })); result.appendChild(row); return result; @@ -125,10 +128,14 @@ SubmapPanel.prototype.createTable = function(models, type) { result.appendChild(table); table.appendChild(self.createTableHeader()); + var tableBody = Functions.createElement({ + type : "tbody", + }); + table.appendChild(tableBody); + for (var i = 0; i < models.length; i++) { - table.appendChild(self.createRow(models[i])); + tableBody.appendChild(self.createRow(models[i])); } - return result; };