view nav.js @ 291:55999edef91d gmap2

Fix view collapse/uncollapse to resize the Gmaps view by triggering a resize event.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 18 Nov 2016 23:22:56 +0200
parents f0327b53c1db
children
line wrap: on
line source

// $Id: nav.js 2291 2009-09-21 14:43:50Z ggr $
var collapsed, css_sidecoll, css_footer, css_map_right, css_map_top;


function pmapSE(name)
{
  return document.getElementById(name);
}


function pmapLE(v1, v2)
{
  return collapsed ? v1 : v2;
}


function pmapInitializeNav()
{
  collapsed = false;
  css_sidecoll   = pmapSE("sidecoll").style.right;
  css_footer     = pmapSE("footer").style.right;
  css_map_right  = pmapSE("map").style.right;
  css_map_top    = pmapSE("map").style.top;
}


function pmapToggleSideBar()
{
  collapsed = !collapsed;

  pmapSE("header").style.display   = pmapLE("none"    , "block");
  pmapSE("sidebar").style.display  = pmapLE("none"    , "block");
  pmapSE("sidecoll").style.right   = pmapLE("0px"     , css_sidecoll);
  pmapSE("footer").style.right     = pmapLE("0px"     , css_footer);
  pmapSE("map").style.right        = pmapLE("8px"     , css_map_right);
  pmapSE("map").style.top          = pmapLE("0px"     , css_map_top);
  pmapSE("collbutton").src         = pmapLE("img/left.gif" , "img/right.gif");

  google.maps.event.trigger(pmap, "resize");
}