Strabon

changeset 612:0332207eb9ea

When the endpoint receives a query and the results will be viewed on a map, scroll to the map.
TODO: Duplicate this behaviour when the "plain" view is selected"
author Kostis Kyzirakos <kkyzir@di.uoa.gr>
date Fri Sep 28 22:03:11 2012 +0300 (2012-09-28)
parents 9a3bfee64a39
children bfba7deaadea
files endpoint/WebContent/query.jsp
line diff
     1.1 --- a/endpoint/WebContent/query.jsp	Fri Sep 28 21:57:34 2012 +0300
     1.2 +++ b/endpoint/WebContent/query.jsp	Fri Sep 28 22:03:11 2012 +0300
     1.3 @@ -62,6 +62,12 @@
     1.4  			var ctaLayer = new google.maps.KmlLayer(kml);
     1.5  			ctaLayer.setMap(map);
     1.6  		<%}%>
     1.7 +		
     1.8 +		<%if ("map".equals(request.getAttribute("handle")) || "map_local".equals(request.getAttribute("handle")) || "plain".equals(request.getAttribute("handle"))) {%>		
     1.9 +			$('html, body').animate({
    1.10 +				scrollTop: $("#divResultsStart").offset().top
    1.11 +			}, 1000);
    1.12 +		<%}%>
    1.13  		}
    1.14  	</script> 
    1.15  <%
    1.16 @@ -251,6 +257,8 @@
    1.17  <%}%>
    1.18  </table></td></tr></table><br/><br/>
    1.19  </form>
    1.20 +<a name="#results">&nbsp;</a>
    1.21 +<div id="divResultsStart"></div>
    1.22  	<!-- Response -->
    1.23  <% if (request.getAttribute("response") != null) {
    1.24  	if (Common.getHTMLFormat().equals(request.getParameter("format"))) {%>
    1.25 @@ -263,5 +271,6 @@
    1.26  <% if (request.getAttribute("pathToKML") != null) { %>
    1.27  	<div id="map_canvas"></div>
    1.28  <%}%>
    1.29 +<div id="divResultsEnd" style="height: 1px; width 1px"></div>
    1.30  </body>
    1.31  </html>