-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheniro.js
31 lines (25 loc) · 1.19 KB
/
eniro.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function addFullscreenButton() {
if ('jQuery' in window) {
var $mapControl = $('.e-full-map');
if ($mapControl.length) {
var $fullscreenButton = $('<div title="Fullskärm" class="e-toggle-button" style="position: absolute; right: 304px; bottom: 26px;"><button class="e-icon">Full</button></div>')
$fullscreenButton.insertAfter($mapControl).click(function(event){
var m = document.getElementById('page');
m.requestFullscreen = m.requestFullscreen ||
m.mozRequestFullScreen ||
m.webkitRequestFullscreen ||
m.msRequestFullscreen;
m.requestFullscreen();
event.preventDefault();
});
$(document).on('fullscreenchange mozfullscreenchange webkitfullscreenchange', function(event) {
$fullscreenButton.toggle(!(document.mozFullScreen || document.webkitIsFullScreen));
});
return;
}
}
if (--addFullscreenButton.retries)
setTimeout(addFullscreenButton, 1500);
}
addFullscreenButton.retries = 10;
addFullscreenButton();