]> dev.renevier.net Git - syj.git/blobdiff - public/js/syj.js
better print support
[syj.git] / public / js / syj.js
index 7b2448cb09481b86a79f90f6120ae6178173baaf..a72dbb71ff6a99d114bf93c1985f1da665cc59f3 100644 (file)
@@ -1,4 +1,4 @@
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
 // avoid openlayers alerts
@@ -441,6 +441,13 @@ var SYJView = {
         } else {
             this.map.setCenter(center, zoom);
         }
+        this.resizeMap();
+    },
+
+    resizeMap: function() {
+        var map = $('map');
+        map.style.width = map.offsetWidth.toString() + 'px';
+        map.style.height = map.offsetHeight.toString() + 'px';
     },
 
     observer: function(evt) {
@@ -611,15 +618,6 @@ var SYJView = {
             case 400:
             case 404:
                 message = SyjStrings.requestError;
-                if (transport.responseJSON) {
-                    switch (transport.responseJSON.message) {
-                        case "uniquepath":
-                            message = SyjStrings.uniquePathError;
-                        break;
-                        default:
-                        break;
-                    }
-                }
             break;
             case 403:
                 message = "";
@@ -1281,3 +1279,7 @@ window.onbeforeunload = function() {
         return undefined;
     }
 };
+
+window.onresize = function() {
+    SYJView.resizeMap();
+};