Merge pull request #8663 from schmidtk/ts-vendor-fullscreen

Add vendor-specific TS declarations for the Fullscreen API.
This commit is contained in:
Frédéric Junod
2018-09-19 15:05:05 +02:00
committed by GitHub
3 changed files with 35 additions and 5 deletions

View File

@@ -34,9 +34,9 @@ const getChangeType = (function() {
/**
* @typedef {Object} Options
* @property {string} [className='ol-full-screen'] CSS class name.
* @property {string|HTMLElement} [label='\u2922'] Text label to use for the button.
* @property {string|Text} [label='\u2922'] Text label to use for the button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|HTMLElement} [labelActive='\u00d7'] Text label to use for the
* @property {string|Text} [labelActive='\u00d7'] Text label to use for the
* button when full-screen is active.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [tipLabel='Toggle full-screen'] Text label to use for the button tip.
@@ -87,7 +87,7 @@ class FullScreen extends Control {
/**
* @private
* @type {HTMLElement}
* @type {Text}
*/
this.labelNode_ = typeof label === 'string' ?
document.createTextNode(label) : label;
@@ -96,7 +96,7 @@ class FullScreen extends Control {
/**
* @private
* @type {HTMLElement}
* @type {Text}
*/
this.labelActiveNode_ = typeof labelActive === 'string' ?
document.createTextNode(labelActive) : labelActive;
@@ -253,7 +253,7 @@ function requestFullScreenWithKeys(element) {
if (element.mozRequestFullScreenWithKeys) {
element.mozRequestFullScreenWithKeys();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
element.webkitRequestFullscreen();
} else {
requestFullScreen(element);
}