Skip to content
Snippets Groups Projects
Commit 6007037f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

all info windows create content div as a promise

parent 1d134744
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -34,7 +34,7 @@ function AbstractInfoWindow(abstractMarker, map) {
var onOverlayFullViewChanged = function(e) {
var self = e.object;
// first change the content of the element
self.update().then(function(){
self.update().then(function() {
if (e.newVal) {
var element = new IdentifiedElement({
objectId : self.getElementId(),
......@@ -353,12 +353,9 @@ AbstractInfoWindow.prototype._updateContent = function() {
var contentDiv = null;
var self = this;
return new Promise(function(resolve, reject) {
self.setContent(self.createWaitingContentDiv());
self.setContent(self.createWaitingContentDiv());
var x = self.createContentDiv();
resolve(x);
}).then(function(content) {
return self.createContentDiv().then(function(content) {
contentDiv = content;
return self.createOverlaysDiv();
}).then(function(overlaysDiv) {
......
......@@ -32,7 +32,7 @@ PointInfoWindow.prototype.createContentDiv = function() {
title.innerHTML = "Point: " + this.pointData.getPoint();
result.appendChild(title);
return result;
return Promise.resolve(result);
};
PointInfoWindow.prototype.getOverlaysData = function(general) {
......
......@@ -41,16 +41,7 @@ ReactionInfoWindow.prototype.constructor = ReactionInfoWindow;
* @returns {String} representing html code for content of the info window
*/
ReactionInfoWindow.prototype.createContentDiv = function() {
if (this._reactionData !== undefined) {
var content = document.createElement("div");
/*
* var title = document.createElement("h3"); title.innerHTML =
* "ReactionInfoWindow is not yet implemented."; content.appendChild(title)
*/
return content;
} else {
return null;
}
return Promise.resolve(document.createElement("div"));
};
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment