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";
/* exported logger */
var AbstractGuiElement = require('./AbstractGuiElement');
var ConfigurationType = require('../ConfigurationType');
var Functions = require('../Functions');
var PanelControlElementType = require('./PanelControlElementType');
// noinspection JSUnusedLocalSymbols
var logger = require('../logger');
function Legend(params) {
......@@ -24,14 +23,14 @@ Legend.prototype._initializeGui = function () {
var legendDiv = Functions.createElement({
type: "div",
id: "legend-div",
className: "carousel slide",
className: "carousel slide"
});
self.getElement().appendChild(legendDiv);
var indicators = Functions.createElement({
type: "ol",
name: "indicators",
className: "carousel-indicators",
className: "carousel-indicators"
});
legendDiv.appendChild(indicators);
self.setControlElement(PanelControlElementType.LEGEND_INDICATORS_OL, indicators);
......@@ -40,7 +39,7 @@ Legend.prototype._initializeGui = function () {
type: "div",
name: "slides",
className: "carousel-inner",
role: "listbox",
role: "listbox"
});
legendDiv.appendChild(slidesDiv);
self.setControlElement(PanelControlElementType.LEGEND_SLIDES_DIV, slidesDiv);
......@@ -74,7 +73,15 @@ Legend.prototype.hide = function () {
this.getElement().style.display = "none";
};
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()).css('z-index', maxZIndex + 1);
};
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