Commit d58a8426 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

open legend always on top

parent 3b2ce9e8
Pipeline #3367 passed with stage
in 58 seconds
"use strict"; "use strict";
/* exported logger */
var AbstractGuiElement = require('./AbstractGuiElement'); var AbstractGuiElement = require('./AbstractGuiElement');
var ConfigurationType = require('../ConfigurationType'); var ConfigurationType = require('../ConfigurationType');
var Functions = require('../Functions'); var Functions = require('../Functions');
var PanelControlElementType = require('./PanelControlElementType'); var PanelControlElementType = require('./PanelControlElementType');
// noinspection JSUnusedLocalSymbols
var logger = require('../logger'); var logger = require('../logger');
function Legend(params) { function Legend(params) {
...@@ -24,14 +23,14 @@ Legend.prototype._initializeGui = function () { ...@@ -24,14 +23,14 @@ Legend.prototype._initializeGui = function () {
var legendDiv = Functions.createElement({ var legendDiv = Functions.createElement({
type: "div", type: "div",
id: "legend-div", id: "legend-div",
className: "carousel slide", className: "carousel slide"
}); });
self.getElement().appendChild(legendDiv); self.getElement().appendChild(legendDiv);
var indicators = Functions.createElement({ var indicators = Functions.createElement({
type: "ol", type: "ol",
name: "indicators", name: "indicators",
className: "carousel-indicators", className: "carousel-indicators"
}); });
legendDiv.appendChild(indicators); legendDiv.appendChild(indicators);
self.setControlElement(PanelControlElementType.LEGEND_INDICATORS_OL, indicators); self.setControlElement(PanelControlElementType.LEGEND_INDICATORS_OL, indicators);
...@@ -40,7 +39,7 @@ Legend.prototype._initializeGui = function () { ...@@ -40,7 +39,7 @@ Legend.prototype._initializeGui = function () {
type: "div", type: "div",
name: "slides", name: "slides",
className: "carousel-inner", className: "carousel-inner",
role: "listbox", role: "listbox"
}); });
legendDiv.appendChild(slidesDiv); legendDiv.appendChild(slidesDiv);
self.setControlElement(PanelControlElementType.LEGEND_SLIDES_DIV, slidesDiv); self.setControlElement(PanelControlElementType.LEGEND_SLIDES_DIV, slidesDiv);
...@@ -74,7 +73,15 @@ Legend.prototype.hide = function () { ...@@ -74,7 +73,15 @@ Legend.prototype.hide = function () {
this.getElement().style.display = "none"; this.getElement().style.display = "none";
}; };
Legend.prototype.show = function () { Legend.prototype.show = function () {
var maxZIndex = Math.max.apply(null,
$.map($('body *'), function (e, n) {
if ($(e).css('position') !== 'static') {
return parseInt($(e).css('z-index')) || 1;
}
}));
this.getElement().style.display = "block"; this.getElement().style.display = "block";
$(this.getElement()).css('z-index', maxZIndex + 1);
}; };
function createLegendIndicator(file, index) { function createLegendIndicator(file, index) {
......
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