Merge pull request #5548 from GaborFarkas/fullscreen_event_enum
Fix CHANGETYPE in ol.control.FullScreen
This commit is contained in:
committed by
Bart van den Eijnden
parent
d3e15e4394
commit
bbfc93b1d8
@@ -162,9 +162,9 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
|||||||
ol.control.FullScreen.prototype.setMap = function(map) {
|
ol.control.FullScreen.prototype.setMap = function(map) {
|
||||||
ol.control.Control.prototype.setMap.call(this, map);
|
ol.control.Control.prototype.setMap.call(this, map);
|
||||||
if (map) {
|
if (map) {
|
||||||
this.listenerKeys.push(
|
this.listenerKeys.push(ol.events.listen(ol.global.document,
|
||||||
ol.events.listen(ol.global.document, ol.control.FullScreen.CHANGETYPE,
|
ol.control.FullScreen.getChangeType_(),
|
||||||
this.handleFullScreenChange_, this)
|
this.handleFullScreenChange_, this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -238,18 +238,24 @@ ol.control.FullScreen.exitFullScreen = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @return {string} Change type.
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.control.FullScreen.CHANGETYPE = (function() {
|
ol.control.FullScreen.getChangeType_ = (function() {
|
||||||
var body = document.body;
|
var changeType;
|
||||||
if (body.webkitRequestFullscreen) {
|
return function() {
|
||||||
return 'webkitfullscreenchange';
|
if (!changeType) {
|
||||||
} else if (body.mozRequestFullScreen) {
|
var body = document.body;
|
||||||
return 'mozfullscreenchange';
|
if (body.webkitRequestFullscreen) {
|
||||||
} else if (body.msRequestFullscreen) {
|
changeType = 'webkitfullscreenchange';
|
||||||
return 'MSFullscreenChange';
|
} else if (body.mozRequestFullScreen) {
|
||||||
} else if (body.requestFullscreen) {
|
changeType = 'mozfullscreenchange';
|
||||||
return 'fullscreenchange';
|
} else if (body.msRequestFullscreen) {
|
||||||
}
|
changeType = 'MSFullscreenChange';
|
||||||
return undefined;
|
} else if (body.requestFullscreen) {
|
||||||
|
changeType = 'fullscreenchange';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return changeType;
|
||||||
|
};
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user