Skip to content

Commit

Permalink
Fullscreen fix for relative styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Aug 10, 2012
1 parent 2ce3672 commit 9c2f320
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions control/mm/fullscreen.js
Expand Up @@ -12,7 +12,7 @@ wax.mm.fullscreen = function() {
a = document.createElement('a'),
map,
body = document.body,
smallSize;
dimensions;

a.className = 'map-fullscreen';
a.href = '#fullscreen';
Expand Down Expand Up @@ -50,18 +50,20 @@ wax.mm.fullscreen = function() {

fullscreen.full = function() {
if (fullscreened) { return; } else { fullscreened = true; }
smallSize = [map.parent.offsetWidth, map.parent.offsetHeight];
dimensions = map.dimensions;
map.parent.className += ' map-fullscreen-map';
body.className += ' map-fullscreen-view';
map.setSize({ x: map.parent.offsetWidth, y: map.parent.offsetHeight });
map.dimensions = { x: map.parent.offsetWidth, y: map.parent.offsetHeight };
map.draw();
return fullscreen;
};

fullscreen.original = function() {
if (!fullscreened) { return; } else { fullscreened = false; }
map.parent.className = map.parent.className.replace(' map-fullscreen-map', '');
body.className = body.className.replace(' map-fullscreen-view', '');
map.setSize({ x: smallSize[0], y: smallSize[1] });
map.dimensions = dimensions;
map.draw();
return fullscreen;
};

Expand Down

0 comments on commit 9c2f320

Please sign in to comment.