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

carousel adapted to bootstrap4

parent 9a66a5a3
......@@ -1230,4 +1230,22 @@ input[type=file] {
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion em {
font-weight: bold;
font-style: normal;
}
.carousel-control-prev {
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, .0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, .0001) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, .0001) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
background-repeat: repeat-x;
}
.carousel-control-next {
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0, rgba(0, 0, 0, .5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0, rgba(0, 0, 0, .5) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0, rgba(0, 0, 0, .5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
background-repeat: repeat-x;
}
\ No newline at end of file
......@@ -50,7 +50,7 @@ Legend.prototype._initializeGui = function () {
self.getElement().appendChild(legendDiv);
var indicators = Functions.createElement({
type: "ol",
type: "ul",
name: "indicators",
className: "carousel-indicators"
});
......@@ -69,10 +69,10 @@ Legend.prototype._initializeGui = function () {
var leftButton = Functions
.createElement({
type: "a",
className: "left carousel-control",
className: "carousel-control-prev",
role: "button",
href: "#legend-div",
content: '<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span><span class="sr-only">Previous</span>',
content: '<span class="carousel-control-prev-icon"></span><span class="sr-only">Previous</span>',
xss: false
});
leftButton.setAttribute("data-slide", "prev");
......@@ -81,10 +81,10 @@ Legend.prototype._initializeGui = function () {
var rightButton = Functions
.createElement({
type: "a",
className: "right carousel-control",
className: "carousel-control-next",
role: "button",
href: "#legend-div",
content: '<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span><span class="sr-only">Next</span>',
content: '<span class="carousel-control-next-icon"></span><span class="sr-only">Next</span>',
xss: false
});
rightButton.setAttribute("data-slide", "next");
......@@ -121,7 +121,7 @@ Legend.prototype.show = function () {
*/
function createLegendIndicator(file, index) {
var result = document.createElement("li");
result.setAttribute("data-target", "legend");
result.setAttribute("data-target", "#legend");
result.setAttribute("data-slide-to", "" + index);
if (index === 0) {
result.className = "active";
......@@ -131,18 +131,19 @@ function createLegendIndicator(file, index) {
/**
*
* @param {string} file
* @param {ConfigurationOption} file
* @param {number} index
* @returns {HTMLDivElement}
*/
function createLegendSlide(file, index) {
var result = document.createElement("div");
if (index === 0) {
result.className = "item active";
result.className = "carousel-item active";
} else {
result.className = "item";
result.className = "carousel-item";
}
var img = document.createElement("img");
// img.className = "d-block w-100";
img.src = file.getValue();
result.appendChild(img);
return result;
......@@ -150,8 +151,8 @@ function createLegendSlide(file, index) {
/**
*
* @param {string[]}legendFiles
* @returns {Promise<string[]>}
* @param {ConfigurationOption[]}legendFiles
* @returns {Promise<ConfigurationOption[]>}
*/
function getValidLegendFiles(legendFiles) {
var result = [];
......@@ -163,7 +164,7 @@ function getValidLegendFiles(legendFiles) {
if (url.indexOf("http") !== 0 && "" !== url) {
url = ServerConnector.getServerBaseUrl() + url;
}
promises.push(ServerConnector.sendGetRequest(url).catch(function (error) {
promises.push(ServerConnector.sendGetRequest(url).catch(function () {
var index = result.indexOf(file);
if (index > -1) {
result.splice(index, 1);
......
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