Commit 3d196903 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

background id must be a number

parent b8d8e958
......@@ -77,7 +77,7 @@ function OverlayPanel(params) {
});
});
$(self.getElement()).on("click", "[name='overlayLink']", function () {
var overlayId = $(this).attr("data");
var overlayId = parseInt($(this).attr("data"));
return self.getMap().openBackground(overlayId);
});
self.getMap().addListener("onBackgroundOverlayChange", function (e) {
......
......@@ -288,9 +288,7 @@ CustomMap.prototype.openDataOverlay = function (param) {
* @param {number} identifier
*/
CustomMap.prototype.openBackground = function (identifier) {
if (identifier.toString() === this.getMapCanvas().getBackgroundId()) {
return Promise.resolve();
} else {
if (identifier.toString() !== this.getMapCanvas().getBackgroundId()) {
var backgroundExists = false;
this.getProject().getBackgrounds().forEach(function (background) {
if (background.getId() === identifier) {
......@@ -310,6 +308,7 @@ CustomMap.prototype.openBackground = function (identifier) {
logger.warn("Background " + identifier + " does not exist");
}
}
return Promise.resolve();
}
/**
* @returns {Background}
......
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