Commit 6a2334d8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

infowindow allows to click on drug/chemical to search for it on the map

parent 9f5d3d21
......@@ -499,10 +499,20 @@ AbstractInfoWindow.prototype._createTableForTargetDiv = function(data, overlay)
}
}
}
row.appendChild(Functions.createElement({
var link = Functions.createElement({
type : "a",
onclick : function(drug) {
return overlay.searchByQuery(nameContent);
},
href : "#",
content : nameContent,
});
var nameTd = Functions.createElement({
type : "td",
content : nameContent
}));
});
nameTd.appendChild(link);
row.appendChild(nameTd);
var referencesCell = Functions.createElement({
type : "td",
......
......@@ -125,6 +125,32 @@ describe('AliasInfoWindow', function() {
});
});
it("createChemicalOverlayInfoDiv", function() {
var map, ie, aliasWindow, oc;
return ServerConnector.getProject().then(function(project) {
map = helper.createCustomMap(project);
oc = helper.createChemicalDbOverlay(map);
ie = new IdentifiedElement({
id : 329170,
modelId : map.getId(),
type : "ALIAS"
});
return map.getModel().getByIdentifiedElement(ie, true);
}).then(function(alias) {
aliasWindow = new AliasInfoWindow({
alias : alias,
map : map
});
return oc.getDetailDataByIdentifiedElement(ie, true);
}).then(function(data) {
var overlayDiv = aliasWindow.createOverlayInfoDiv(oc, data);
assert.ok(functions.isDomElement(overlayDiv));
});
});
it("createCommentOverlayInfoDiv", function() {
var map = helper.createCustomMap();
......
[{"elementId":"sa32","symbol":null,"formerSymbols":[],"other":{"structuralState":null,"modifications":[]},"notes":"","references":[{"resource":"622","link":"http://www.ncbi.nlm.nih.gov/gene/622","id":860352,"type":"ENTREZ"}],"modelId":15781,"synonyms":[],"fullName":null,"complexId":null,"type":"Protein","abbreviation":null,"compartmentId":null,"name":"BDH1","bounds":{"x":1225.7682370820667,"width":80.0,"y":66.0,"height":40.0},"formula":null,"id":329170,"linkedSubmodel":null,"hierarchyVisibilityLevel":"0"}]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment