Skip to content

Commit

Permalink
Merge pull request openlayers#7914 from gberaudo/some_easy_window_cle…
Browse files Browse the repository at this point in the history
…anups

Some easy window cleanups
  • Loading branch information
tschaub committed Mar 3, 2018
2 parents d0a8ae7 + 6280941 commit b3d9156
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/ol/PluggableMap.js
Expand Up @@ -507,7 +507,7 @@ PluggableMap.prototype.disposeInternal = function() {
unlisten(this.viewport_, EventType.MOUSEWHEEL,
this.handleBrowserEvent, this);
if (this.handleResize_ !== undefined) {
window.removeEventListener(EventType.RESIZE,
removeEventListener(EventType.RESIZE,
this.handleResize_, false);
this.handleResize_ = undefined;
}
Expand Down Expand Up @@ -1010,7 +1010,7 @@ PluggableMap.prototype.handleTargetChanged_ = function() {
this.renderer_.removeLayerRenderers();
removeNode(this.viewport_);
if (this.handleResize_ !== undefined) {
window.removeEventListener(EventType.RESIZE,
removeEventListener(EventType.RESIZE,
this.handleResize_, false);
this.handleResize_ = undefined;
}
Expand All @@ -1028,7 +1028,7 @@ PluggableMap.prototype.handleTargetChanged_ = function() {

if (!this.handleResize_) {
this.handleResize_ = this.updateSize.bind(this);
window.addEventListener(EventType.RESIZE,
addEventListener(EventType.RESIZE,
this.handleResize_, false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ol/index.js
Expand Up @@ -41,7 +41,7 @@ let WEBGL_EXTENSIONS; // value is set below
let HAS_WEBGL = false;


if ('WebGLRenderingContext' in window) {
if (typeof window !== 'undefined' && 'WebGLRenderingContext' in window) {
try {
const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS'));
const gl = getContext(canvas, {failIfMajorPerformanceCaveat: true});
Expand Down
4 changes: 2 additions & 2 deletions src/ol/render/canvas.js
Expand Up @@ -167,7 +167,7 @@ export const checkFont = (function() {
}
}
if (done) {
window.clearInterval(interval);
clearInterval(interval);
interval = undefined;
}
}
Expand All @@ -184,7 +184,7 @@ export const checkFont = (function() {
if (!isAvailable(fontFamily)) {
checked[fontFamily] = 0;
if (interval === undefined) {
interval = window.setInterval(check, 32);
interval = setInterval(check, 32);
}
}
}
Expand Down

0 comments on commit b3d9156

Please sign in to comment.