Skip to content

Commit

Permalink
move file to src folder and add case for IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
colleenmcginnis committed Feb 21, 2017
1 parent b64e67d commit 945b047
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ class FullscreenControl {
}

_changeIcon(e) {
console.log(e);
this._fullscreen = !this._fullscreen;
const className = 'mapboxgl-ctrl';
this._fullscreenButton.classList.toggle(`${className}-shrink`);
this._fullscreenButton.classList.toggle(`${className}-fullscreen`);
if (e.target === this._mapContainer) {
this._fullscreen = !this._fullscreen;
const className = 'mapboxgl-ctrl';
this._fullscreenButton.classList.toggle(`${className}-shrink`);
this._fullscreenButton.classList.toggle(`${className}-fullscreen`);
}
}

_onClickFullscreen() {
Expand All @@ -67,14 +68,18 @@ class FullscreenControl {
window.document.exitFullscreen();
} else if (window.document.mozCancelFullScreen) {
window.document.mozCancelFullScreen();
} else {
} else if (window.document.msExitFullscreen) {
window.document.msExitFullscreen();
} else if (window.document.webkitCancelFullScreen) {
window.document.webkitCancelFullScreen();
}
} else if (this._mapContainer.requestFullscreen) {
this._mapContainer.requestFullscreen();
} else if (this._mapContainer.mozRequestFullScreen) {
this._mapContainer.mozRequestFullScreen();
} else {
} else if (this._mapContainer.msRequestFullscreen) {
this._mapContainer.msRequestFullscreen();
} else if (this._mapContainer.webkitRequestFullscreen) {
this._mapContainer.webkitRequestFullscreen();
}
}
Expand Down

0 comments on commit 945b047

Please sign in to comment.