Use Element type instead of Node for an html element

This commit is contained in:
Frederic Junod
2018-03-09 16:59:58 +01:00
parent 6b07646129
commit 2e34421c71
4 changed files with 36 additions and 36 deletions

View File

@@ -204,8 +204,8 @@ olx.control;
* collapsible: (boolean|undefined), * collapsible: (boolean|undefined),
* collapsed: (boolean|undefined), * collapsed: (boolean|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* label: (string|Node|undefined), * label: (string|Element|undefined),
* collapseLabel: (string|Node|undefined), * collapseLabel: (string|Element|undefined),
* render: (function(ol.MapEvent)|undefined), * render: (function(ol.MapEvent)|undefined),
* target: (Element|string|undefined)}} * target: (Element|string|undefined)}}
*/ */
@@ -258,8 +258,8 @@ olx.control.AttributionOptions.prototype.tipLabel;
/** /**
* Text label to use for the collapsed attributions button. Default is `i`. * Text label to use for the collapsed attributions button. Default is `i`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.AttributionOptions.prototype.label; olx.control.AttributionOptions.prototype.label;
@@ -267,8 +267,8 @@ olx.control.AttributionOptions.prototype.label;
/** /**
* Text label to use for the expanded attributions button. Default is `»`. * Text label to use for the expanded attributions button. Default is `»`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.AttributionOptions.prototype.collapseLabel; olx.control.AttributionOptions.prototype.collapseLabel;
@@ -320,8 +320,8 @@ olx.control.ControlOptions.prototype.target;
/** /**
* @typedef {{className: (string|undefined), * @typedef {{className: (string|undefined),
* label: (string|Node|undefined), * label: (string|Element|undefined),
* labelActive: (string|Node|undefined), * labelActive: (string|Element|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* keys: (boolean|undefined), * keys: (boolean|undefined),
* target: (Element|string|undefined), * target: (Element|string|undefined),
@@ -340,8 +340,8 @@ olx.control.FullScreenOptions.prototype.className;
/** /**
* Text label to use for the button. Default is `\u2922` (NORTH EAST AND SOUTH WEST ARROW). * Text label to use for the button. Default is `\u2922` (NORTH EAST AND SOUTH WEST ARROW).
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.FullScreenOptions.prototype.label; olx.control.FullScreenOptions.prototype.label;
@@ -350,8 +350,8 @@ olx.control.FullScreenOptions.prototype.label;
/** /**
* Text label to use for the button when full-screen is active. * Text label to use for the button when full-screen is active.
* Default is `\u00d7` (a cross). * Default is `\u00d7` (a cross).
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.FullScreenOptions.prototype.labelActive; olx.control.FullScreenOptions.prototype.labelActive;
@@ -451,9 +451,9 @@ olx.control.MousePositionOptions.prototype.undefinedHTML;
/** /**
* @typedef {{collapsed: (boolean|undefined), * @typedef {{collapsed: (boolean|undefined),
* collapseLabel: (string|Node|undefined), * collapseLabel: (string|Element|undefined),
* collapsible: (boolean|undefined), * collapsible: (boolean|undefined),
* label: (string|Node|undefined), * label: (string|Element|undefined),
* layers: (Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>|undefined), * layers: (Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>|undefined),
* render: (function(ol.MapEvent)|undefined), * render: (function(ol.MapEvent)|undefined),
* target: (Element|string|undefined), * target: (Element|string|undefined),
@@ -474,8 +474,8 @@ olx.control.OverviewMapOptions.prototype.collapsed;
/** /**
* Text label to use for the expanded overviewmap button. Default is `«`. * Text label to use for the expanded overviewmap button. Default is `«`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.OverviewMapOptions.prototype.collapseLabel; olx.control.OverviewMapOptions.prototype.collapseLabel;
@@ -491,8 +491,8 @@ olx.control.OverviewMapOptions.prototype.collapsible;
/** /**
* Text label to use for the collapsed overviewmap button. Default is `»`. * Text label to use for the collapsed overviewmap button. Default is `»`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.OverviewMapOptions.prototype.label; olx.control.OverviewMapOptions.prototype.label;
@@ -617,7 +617,7 @@ olx.control.RotateOptions.prototype.className;
/** /**
* Text label to use for the rotate button. Default is `⇧`. * Text label to use for the rotate button. Default is `⇧`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Element|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
@@ -678,8 +678,8 @@ olx.control.RotateOptions.prototype.target;
/** /**
* @typedef {{duration: (number|undefined), * @typedef {{duration: (number|undefined),
* className: (string|undefined), * className: (string|undefined),
* zoomInLabel: (string|Node|undefined), * zoomInLabel: (string|Element|undefined),
* zoomOutLabel: (string|Node|undefined), * zoomOutLabel: (string|Element|undefined),
* zoomInTipLabel: (string|undefined), * zoomInTipLabel: (string|undefined),
* zoomOutTipLabel: (string|undefined), * zoomOutTipLabel: (string|undefined),
* delta: (number|undefined), * delta: (number|undefined),
@@ -706,8 +706,8 @@ olx.control.ZoomOptions.prototype.className;
/** /**
* Text label to use for the zoom-in button. Default is `+`. * Text label to use for the zoom-in button. Default is `+`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.ZoomOptions.prototype.zoomInLabel; olx.control.ZoomOptions.prototype.zoomInLabel;
@@ -715,8 +715,8 @@ olx.control.ZoomOptions.prototype.zoomInLabel;
/** /**
* Text label to use for the zoom-out button. Default is `-`. * Text label to use for the zoom-out button. Default is `-`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.ZoomOptions.prototype.zoomOutLabel; olx.control.ZoomOptions.prototype.zoomOutLabel;
@@ -809,7 +809,7 @@ olx.control.ZoomSliderOptions.prototype.render;
/** /**
* @typedef {{className: (string|undefined), * @typedef {{className: (string|undefined),
* target: (Element|string|undefined), * target: (Element|string|undefined),
* label: (string|Node|undefined), * label: (string|Element|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* extent: (ol.Extent|undefined)}} * extent: (ol.Extent|undefined)}}
*/ */
@@ -835,8 +835,8 @@ olx.control.ZoomToExtentOptions.prototype.target;
/** /**
* Text label to use for the button. Default is `E`. * Text label to use for the button. Default is `E`.
* Instead of text, also a Node (e.g. a `span` element) can be used. * Instead of text, also an element (e.g. a `span` element) can be used.
* @type {string|Node|undefined} * @type {string|Element|undefined}
* @api * @api
*/ */
olx.control.ZoomToExtentOptions.prototype.label; olx.control.ZoomToExtentOptions.prototype.label;

View File

@@ -58,7 +58,7 @@ const Attribution = function(opt_options) {
if (typeof collapseLabel === 'string') { if (typeof collapseLabel === 'string') {
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.collapseLabel_ = document.createElement('span'); this.collapseLabel_ = document.createElement('span');
this.collapseLabel_.textContent = collapseLabel; this.collapseLabel_.textContent = collapseLabel;
@@ -71,7 +71,7 @@ const Attribution = function(opt_options) {
if (typeof label === 'string') { if (typeof label === 'string') {
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.label_ = document.createElement('span'); this.label_ = document.createElement('span');
this.label_.textContent = label; this.label_.textContent = label;

View File

@@ -64,7 +64,7 @@ const FullScreen = function(opt_options) {
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.labelNode_ = typeof label === 'string' ? this.labelNode_ = typeof label === 'string' ?
document.createTextNode(label) : label; document.createTextNode(label) : label;
@@ -73,7 +73,7 @@ const FullScreen = function(opt_options) {
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.labelActiveNode_ = typeof labelActive === 'string' ? this.labelActiveNode_ = typeof labelActive === 'string' ?
document.createTextNode(labelActive) : labelActive; document.createTextNode(labelActive) : labelActive;
@@ -217,7 +217,7 @@ function isFullScreen() {
/** /**
* Request to fullscreen an element. * Request to fullscreen an element.
* @param {Node} element Element to request fullscreen * @param {Element} element Element to request fullscreen
*/ */
function requestFullScreen(element) { function requestFullScreen(element) {
if (element.requestFullscreen) { if (element.requestFullscreen) {
@@ -233,7 +233,7 @@ function requestFullScreen(element) {
/** /**
* Request to fullscreen an element with keyboard input. * Request to fullscreen an element with keyboard input.
* @param {Node} element Element to request fullscreen * @param {Element} element Element to request fullscreen
*/ */
function requestFullScreenWithKeys(element) { function requestFullScreenWithKeys(element) {
if (element.mozRequestFullScreenWithKeys) { if (element.mozRequestFullScreenWithKeys) {

View File

@@ -74,7 +74,7 @@ const OverviewMap = function(opt_options) {
if (typeof collapseLabel === 'string') { if (typeof collapseLabel === 'string') {
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.collapseLabel_ = document.createElement('span'); this.collapseLabel_ = document.createElement('span');
this.collapseLabel_.textContent = collapseLabel; this.collapseLabel_.textContent = collapseLabel;
@@ -88,7 +88,7 @@ const OverviewMap = function(opt_options) {
if (typeof label === 'string') { if (typeof label === 'string') {
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.label_ = document.createElement('span'); this.label_ = document.createElement('span');
this.label_.textContent = label; this.label_.textContent = label;