Mercurial > hg > batmud > gmap2
annotate 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 |
rev | line source |
---|---|
16 | 1 // $Id: nav.js 2291 2009-09-21 14:43:50Z ggr $ |
153 | 2 var collapsed, css_sidecoll, css_footer, css_map_right, css_map_top; |
3 | |
4 | |
134 | 5 function pmapSE(name) |
2 | 6 { |
126 | 7 return document.getElementById(name); |
8 } | |
9 | |
10 | |
134 | 11 function pmapLE(v1, v2) |
126 | 12 { |
13 return collapsed ? v1 : v2; | |
14 } | |
15 | |
69
7519bfce5093
Collapse also the header, when collapsing sidebar.
Matti Hamalainen <ccr@tnsp.org>
parents:
38
diff
changeset
|
16 |
168 | 17 function pmapInitializeNav() |
18 { | |
19 collapsed = false; | |
20 css_sidecoll = pmapSE("sidecoll").style.right; | |
21 css_footer = pmapSE("footer").style.right; | |
22 css_map_right = pmapSE("map").style.right; | |
23 css_map_top = pmapSE("map").style.top; | |
24 } | |
25 | |
26 | |
134 | 27 function pmapToggleSideBar() |
126 | 28 { |
157 | 29 collapsed = !collapsed; |
126 | 30 |
134 | 31 pmapSE("header").style.display = pmapLE("none" , "block"); |
32 pmapSE("sidebar").style.display = pmapLE("none" , "block"); | |
33 pmapSE("sidecoll").style.right = pmapLE("0px" , css_sidecoll); | |
34 pmapSE("footer").style.right = pmapLE("0px" , css_footer); | |
35 pmapSE("map").style.right = pmapLE("8px" , css_map_right); | |
36 pmapSE("map").style.top = pmapLE("0px" , css_map_top); | |
37 pmapSE("collbutton").src = pmapLE("img/left.gif" , "img/right.gif"); | |
291
55999edef91d
Fix view collapse/uncollapse to resize the Gmaps view by triggering a resize event.
Matti Hamalainen <ccr@tnsp.org>
parents:
168
diff
changeset
|
38 |
55999edef91d
Fix view collapse/uncollapse to resize the Gmaps view by triggering a resize event.
Matti Hamalainen <ccr@tnsp.org>
parents:
168
diff
changeset
|
39 google.maps.event.trigger(pmap, "resize"); |
2 | 40 } |