Commit 11bc054d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

separate backgrounds from general overlays

parent ea5daf77
Pipeline #46678 passed with stage
in 16 minutes and 46 seconds
minerva (16.0.0~beta.2) stable; urgency=medium
* Small improvement: backgrounds are separated from general overlays (#1532)
* Bug fix: correct background order for old projects restored (#1533)
* Bug fix: search chemicals by target returned chemicals not bounded by
disease (#1535)
......
......@@ -114,6 +114,27 @@ OverlayPanel.prototype.constructor = OverlayPanel;
* @private
*/
OverlayPanel.prototype._createOverlayPanelGui = function () {
var backgroundsDiv = Functions.createElement({
type: "div",
name: "backgroundsOverlays",
className: "searchPanel"
});
this.getElement().appendChild(backgroundsDiv);
var backgroundsTitle = Functions.createElement({
type: "h5",
content: "BACKGROUNDS:"
});
backgroundsDiv.appendChild(backgroundsTitle);
var backgroundsTableDiv = Functions.createElement({
type: "table",
name: "backgroundsTab",
className: "table table-bordered",
style: "width:100%"
});
backgroundsDiv.appendChild(backgroundsTableDiv);
var generalOverlaysDiv = Functions.createElement({
type: "div",
name: "generalOverlays",
......@@ -338,8 +359,6 @@ OverlayPanel.prototype.createBackgroundRow = function (background, checked) {
result.appendChild(viewTd);
var dataTd = document.createElement("td");
result.appendChild(dataTd);
result.title = background.getDescription();
return result;
};
......@@ -572,13 +591,25 @@ OverlayPanel.prototype.refresh = function (showDefault) {
} else {
customOverlays.push(overlay);
}
}
var table = self.getControlElement(PanelControlElementType.OVERLAY_GENERAL_OVERLAY_TABLE);
table.appendChild(self.createTableHeader());
var table = $("[name='backgroundsTab']", self.getElement())[0];
table.innerHTML = "<thead><tr><th>Name</th><th>View</th></tr></thead>";
var body = document.createElement("tbody");
table.appendChild(body);
for (i = 0; i < backgrounds.length; i++) {
var background = backgrounds[i];
body.appendChild(self.createBackgroundRow(background, background === selectedBackground));
}
table = self.getControlElement(PanelControlElementType.OVERLAY_GENERAL_OVERLAY_TABLE);
table.appendChild(self.createTableHeader());
body = document.createElement("tbody");
table.appendChild(body);
generalOverlays.sort(function (o1, o2) {
var val1 = o1.getId();
var val2 = o2.getId();
......@@ -594,14 +625,15 @@ OverlayPanel.prototype.refresh = function (showDefault) {
}
return 0;
});
for (i = 0; i < backgrounds.length; i++) {
var background = backgrounds[i];
body.appendChild(self.createBackgroundRow(background, background === selectedBackground));
}
for (i = 0; i < generalOverlays.length; i++) {
overlay = generalOverlays[i];
body.appendChild(self.createOverlayRow(overlay, selectedOverlay[overlay.getId()], false));
}
if (generalOverlays.length > 0) {
$(table.parentNode).show();
} else {
$(table.parentNode).hide();
}
var title = self.getControlElement(PanelControlElementType.OVERLAY_CUSTOM_OVERLAY_TITLE);
var addButton = $("[name='addOverlay']", self.getElement());
......
Markdown is supported
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