Use blocked scoped variables

In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
Tim Schaub
2018-01-11 23:32:36 -07:00
parent 0bf2b04dee
commit ad62739a6e
684 changed files with 18120 additions and 18184 deletions

View File

@@ -36,7 +36,7 @@ import _ol_events_ from '../events.js';
* @param {olx.control.ControlOptions} options Control options.
* @api
*/
var Control = function(options) {
const Control = function(options) {
BaseObject.call(this);
@@ -109,18 +109,18 @@ Control.prototype.setMap = function(map) {
if (this.map_) {
removeNode(this.element);
}
for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
for (let i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
_ol_events_.unlistenByKey(this.listenerKeys[i]);
}
this.listenerKeys.length = 0;
this.map_ = map;
if (this.map_) {
var target = this.target_ ?
const target = this.target_ ?
this.target_ : map.getOverlayContainerStopEvent();
target.appendChild(this.element);
if (this.render !== nullFunction) {
this.listenerKeys.push(_ol_events_.listen(map,
MapEventType.POSTRENDER, this.render, this));
MapEventType.POSTRENDER, this.render, this));
}
map.render();
}