]> dev.renevier.net Git - syj.git/commitdiff
better mobile support
authorarno <arno@renevier.net>
Sat, 26 Mar 2011 08:31:45 +0000 (09:31 +0100)
committerarno <arno@renevier.net>
Sat, 26 Mar 2011 09:20:28 +0000 (10:20 +0100)
application/controllers/IdxController.php
application/views/scripts/idx/index.phtml
public/css/syj.css
public/js/syj.js
public/js/utils.js
public/modifiablepath

index d24b71ca82a79e38d301c085b3fbc63c40f189c0..c049809247870a4b9c0828b669d4536b100499b8 100644 (file)
@@ -11,6 +11,7 @@ class IdxController extends Zend_Controller_Action
         $this->view->headLink()->appendStylesheet('css/generic.css', "screen");
         $this->view->headLink()->appendStylesheet('css/syj.css', "screen");
         $this->view->headLink()->appendStylesheet('css/syjprint.css', "print");
+        $this->view->headMeta()->appendName('viewport', 'width=640px');
     }
 
     public function rawmode(Syj_Model_Path $path) {
index ac7e9dd16c830b143536d32ee313993f95a09ba1..455f90b6f1f3010b2bfd056317a3c7edbeaff97e 100644 (file)
@@ -13,7 +13,7 @@
 
 <?php
 $message = "";
-$msgclass = "info";
+$msgclass = "";
 if ($this->errorMsg) {
     $message .= $this->errorMsg;
     $msgclass = "error";
@@ -23,6 +23,7 @@ if ($this->errorMsg) {
     $message .= $this->translate('To create a journey, just press <strong>"start a route"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner');
     $message .= "<br>";
     $message .= $this->translate('When you have finished a path, press "create", button.');
+    $msgclass = "info optional";
 }
 ?>
 
index d6ce283c0a4f76b380b6eb82b72586f41f598425..9dc2a6926dfbddcae75a70f3c0c9d406a59ae61e 100644 (file)
@@ -46,6 +46,11 @@ body, html {
     -webkit-border-radius: 5px;
     border-radius: 5px;
 }
+@media screen and (max-width: 640px) {
+    #message.optional {
+        display: none;
+    }
+}
 
 /*
  * menu rules
@@ -78,6 +83,7 @@ body, html {
     -webkit-border-radius: 5px;
     border-radius: 5px;
     background-color: white;
+    cursor: pointer;
 }
 .menu-item:hover {
     background-color: #E0E0FF;
@@ -117,6 +123,7 @@ body, html {
 
 #data_controls {
     position: absolute;
+    z-index: 11; /* to be over login-controls */
     right: 0.5em;
     bottom: 3em;
     text-align: center;
@@ -175,6 +182,7 @@ body, html {
     background-color: white;
     padding: 5px 1px 5px 1px;
     position: relative; /* otherwise, under #map in ie */
+    margin-bottom: 10px;
 }
 
 /* nominatim-suggestions */
index a72dbb71ff6a99d114bf93c1985f1da665cc59f3..78d7606afe2276634e0db2b6227bb40cf591f22e 100644 (file)
@@ -100,7 +100,12 @@ var SYJDataUi = (function() {
             if (!infotoggler) {
                 infotoggler = new Toggler('path-infos-content');
                 $("path-infos-toggler").insert({bottom: infotoggler.element});
-                $("path-infos-anchor").observe('click', function(evt) {
+                var anchor = $("path-infos-anchor");
+                var parent = anchor.up('.menu-item');
+                if (parent) {
+                    anchor = parent;
+                }
+                anchor.observe('click', function(evt) {
                     evt.stop();
                     infotoggler.toggle(evt);
                 });
@@ -658,7 +663,12 @@ var SYJModalClass = Class.create({
             closeMethods: ["onescapekey", "onouterclick", "onbutton"]
         });
 
-        $(this.type + "_control_anchor").observe("click", function(evt) {
+        var anchor = $(this.type + '_control_anchor');
+        var parent = anchor.up('.menu-item');
+        if (parent) {
+            anchor = parent;
+        }
+        anchor.observe("click", function(evt) {
             this.modalbox.show();
             evt.stop();
         }.bindAsEventListener(this));
index 447ea348c035cb888cf6dd40054bb3dc2dea637b..8936797b79db1080f973fde7d49764eeaa44a1be 100644 (file)
@@ -438,10 +438,16 @@ Element.addMethods('div', {
     },
 
     setMessageStatus: function(div, status) {
-        return div.removeClassName('error').
-                removeClassName('warn').
-                removeClassName('info').
-                removeClassName('success').
-                addClassName(status);
+        $A(["error", "warn", "info", "success", "optional"]).each(function(clname) {
+            div.removeClassName(clname);
+        });
+        if (typeof status === "string") {
+            div.addClassName(status);
+        } else {
+            $A(status).each(function(clname) {
+                div.addClassName(clname);
+            });
+        }
+        return div;
     }
 });
index e0ddb083172efd0ac1af0436e695ac180d3d7b74..f92ab9b8184be61241eec13d8dd470f35c10fc4b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit e0ddb083172efd0ac1af0436e695ac180d3d7b74
+Subproject commit f92ab9b8184be61241eec13d8dd470f35c10fc4b