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

Merge branch...

Merge branch '161-submaps-popup-should-appear-in-the-center-of-map-not-the-whole-window' into 'master'

Resolve "Submaps popup should appear in the center of map (not the whole window)"

Closes #161

See merge request !83
parents 65894abf fe9098ba
No related branches found
No related tags found
1 merge request!83Resolve "Submaps popup should appear in the center of map (not the whole window)"
......@@ -62,11 +62,18 @@ Submap.prototype.open = function(htmlTag) {
mapDiv.style.height = "100%";
contentDiv.appendChild(mapDiv);
$(self.htmlTag).dialog("open");
$(self.htmlTag).dialog('option', 'title', self.getModel().getName());
$(self.htmlTag).dialog({
title : self.getModel().getName(),
width : Math.floor(window.innerWidth * 2 / 3),
height : Math.floor(window.innerHeight * 2 / 3),
position : {
my : "center",
at : "center",
of : $(self.getTopMap().getElement()),
},
});
$(self.htmlTag).dialog("option", "width", Math.floor(window.innerWidth * 2 / 3));
$(self.htmlTag).dialog("option", "height", Math.floor(window.innerHeight * 2 / 3));
$(self.htmlTag).dialog("open");
self.setGoogleMap(new google.maps.Map(mapDiv, mapOptions));
self._createMapChangedCallbacks();
......@@ -99,7 +106,6 @@ Submap.prototype.open = function(htmlTag) {
self.initialized = true;
} else {
$(self.htmlTag).dialog("open");
}
};
......@@ -110,26 +116,6 @@ Submap.prototype.openDataOverlay = function(identifier) {
}
};
Submap.prototype.loadSubmapConfiguration = function() {
var self = this;
var onConfigurationReload = function() {
var submodelFound = false;
for (var i = 0; i < self.getTopMap().configuration.SUBMODELS.length && (!submodelFound); i++) {
if (self.getTopMap().configuration.SUBMODELS[i].getId() === self.getId()) {
self.configuration = self.getTopMap().configuration.SUBMODELS[i];
submodelFound = true;
}
}
if (!submodelFound) {
throw "Cannot find configuration for submodel " + self.getId();
}
logger.debug("Submodel config reloaded: " + self.getId());
};
onConfigurationReload();
this.getTopMap().configuration.addListener("onreload", onConfigurationReload);
};
Submap.prototype.getTopMap = function() {
return this.getCustomMap();
};
......
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