Skip to content
Snippets Groups Projects
Commit a8c17c0d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when clicking on drug last drug name was used (not the current)

parent 0556d226
No related branches found
No related tags found
1 merge request!89Resolve "Drugs - Show all - content and alignment"
...@@ -32,19 +32,17 @@ function AbstractInfoWindow(params) { ...@@ -32,19 +32,17 @@ function AbstractInfoWindow(params) {
var onOverlayFullViewChanged = function(e) { var onOverlayFullViewChanged = function(e) {
var self = e.object; var self = e.object;
// first change the content of the element // first change the content of the element
return self.update().then( return self.update().then(function() {
function() { if (e.newVal) {
if (e.newVal) { var element = new IdentifiedElement({
var element = new IdentifiedElement({ objectId : self.getElementId(),
objectId : self.getElementId(), modelId : self.getCustomMap().getId(),
modelId : self.getCustomMap().getId(), type : self.getElementType()
type : self.getElementType()
});
return self.getCustomMap().getTopMap().retrieveOverlayDetailDataForElement(element,
self.getOverlayFullViewArray());
}
}); });
var topMap = self.getCustomMap().getTopMap();
return topMap.retrieveOverlayDetailDataForElement(element, self.getOverlayFullViewArray());
}
});
}; };
...@@ -480,6 +478,11 @@ AbstractInfoWindow.prototype._createTableForTargetDiv = function(data, overlay) ...@@ -480,6 +478,11 @@ AbstractInfoWindow.prototype._createTableForTargetDiv = function(data, overlay)
table.appendChild(header); table.appendChild(header);
var row; var row;
var onclick = function() {
// ';' enforces single query (in case there are ',' characters in the name)
return overlay.searchByQuery(this.innerHTML + ";");
};
var count = 0; var count = 0;
for ( var searchId in data) { for ( var searchId in data) {
if (data.hasOwnProperty(searchId)) { if (data.hasOwnProperty(searchId)) {
...@@ -501,9 +504,7 @@ AbstractInfoWindow.prototype._createTableForTargetDiv = function(data, overlay) ...@@ -501,9 +504,7 @@ AbstractInfoWindow.prototype._createTableForTargetDiv = function(data, overlay)
} }
var link = Functions.createElement({ var link = Functions.createElement({
type : "a", type : "a",
onclick : function(drug) { onclick : onclick,
return overlay.searchByQuery(nameContent);
},
href : "#", href : "#",
content : nameContent, content : nameContent,
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment