aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js')
-rw-r--r--web/js/nms-map.js14
-rw-r--r--web/js/nms.js2
2 files changed, 16 insertions, 0 deletions
diff --git a/web/js/nms-map.js b/web/js/nms-map.js
index 5927324..179d8e5 100644
--- a/web/js/nms-map.js
+++ b/web/js/nms-map.js
@@ -140,6 +140,20 @@ nmsMap._initContexts = function() {
}
};
+/*
+ * Used to force a resize if a regular event isn't sent. Typically if the
+ * window itself isn't resized, but available space for the map is still
+ * changed. Example: The menu is toggled. So far this is the same as
+ * _resizeEvent, but there is no guarantee that will stay true.
+ */
+nmsMap.forceResize = function() {
+ if (this._init == true) {
+ return;
+ }
+ nmsMap._resizeEvent();
+}
+
+
nmsMap._resizeEvent = function() {
var width = window.innerWidth - nmsMap._c.bg.c.offsetLeft;
var height = window.innerHeight - nmsMap._c.bg.c.offsetTop;
diff --git a/web/js/nms.js b/web/js/nms.js
index 0422f00..7eb3dfd 100644
--- a/web/js/nms.js
+++ b/web/js/nms.js
@@ -449,7 +449,9 @@ function setMenu()
{
var nav = document.getElementsByTagName("nav")[0];
nav.style.display = nms.menuShowing ? '' : 'none';
+ nmsMap.forceResize();
}
+
function setOplog()
{
var nav = document.getElementById("oplog-parent-mini");