Procházet zdrojové kódy

Use explicit window timer functions

Steven Silvester před 8 roky
rodič
revize
bb91c83923

+ 1 - 1
src/codeeditor/widget.ts

@@ -106,7 +106,7 @@ class CodeEditorWidget extends Widget {
     if (msg.width < 0 || msg.height < 0) {
       if (this._resizing === -1) {
         this._editor.setSize(null);
-        this._resizing = setTimeout(() => {
+        this._resizing = window.setTimeout(() => {
           if (this._needsResize) {
             this._editor.setSize(null);
             this._needsResize = false;

+ 1 - 1
src/common/activitymonitor.ts

@@ -66,7 +66,7 @@ class ActivityMonitor<Sender, Args> implements IDisposable {
     clearTimeout(this._timer);
     this._sender = sender;
     this._args = args;
-    this._timer = setTimeout(() => {
+    this._timer = window.setTimeout(() => {
       this.activityStopped.emit({
         sender: this._sender,
         args: this._args

+ 1 - 1
src/common/dragscroll.ts

@@ -67,7 +67,7 @@ class DragScrollHandler {
        this._isScrolling = true;
        this._scrollAmount = 0;
        // Update at 60fps.
-       this._scrollInterval = setInterval(() => {
+       this._scrollInterval = window.setInterval(() => {
           if (this._scrollAmount === 0) {
             return;
           }

+ 1 - 1
src/docmanager/savehandler.ts

@@ -106,7 +106,7 @@ class SaveHandler implements IDisposable {
     if (!this._isActive) {
       return;
     }
-    this._autosaveTimer = setTimeout(() => {
+    this._autosaveTimer = window.setTimeout(() => {
       this._save();
     }, this._interval);
   }

+ 2 - 2
src/filebrowser/listing.ts

@@ -892,7 +892,7 @@ class DirListing extends Widget {
     event.stopPropagation();
 
     clearTimeout(this._selectTimer);
-    this._noSelectTimer = setTimeout(() => {
+    this._noSelectTimer = window.setTimeout(() => {
       this._noSelectTimer = -1;
     }, RENAME_DURATION);
 
@@ -1099,7 +1099,7 @@ class DirListing extends Widget {
     } else {
       // Handle a rename.
       if (inText && selected.length === 1 && selected[0] === name) {
-        this._selectTimer = setTimeout(() => {
+        this._selectTimer = window.setTimeout(() => {
           if (this._noSelectTimer === -1) {
             this._doRename();
           }

+ 4 - 4
src/filebrowser/model.ts

@@ -63,7 +63,7 @@ class FileBrowserModel implements IDisposable, IPathTracker {
     this._manager.contents.fileChanged.connect(this._onFileChanged, this);
     this._manager.sessions.runningChanged.connect(this._onRunningChanged, this);
     this._scheduleUpdate();
-    this._refreshId = setInterval(() => {
+    this._refreshId = window.setInterval(() => {
       this._scheduleUpdate();
     }, REFRESH_DURATION);
   }
@@ -467,17 +467,17 @@ class FileBrowserModel implements IDisposable, IPathTracker {
       this._requested = true;
       return;
     }
-    this._timeoutId = setTimeout(() => {
+    this._timeoutId = window.setTimeout(() => {
       this.refresh();
       if (this._requested && this._blackoutId !== -1) {
         this._requested = false;
         clearTimeout(this._blackoutId);
         this._blackoutId = -1;
-        this._timeoutId = setTimeout(() => {
+        this._timeoutId = window.setTimeout(() => {
           this._scheduleUpdate();
         }, MIN_REFRESH);
       } else {
-        this._blackoutId = setTimeout(() => {
+        this._blackoutId = window.setTimeout(() => {
           this._blackoutId = -1;
           if (this._requested) {
             this._scheduleUpdate();

+ 1 - 1
src/outputarea/widget.ts

@@ -366,7 +366,7 @@ class OutputAreaWidget extends Widget {
       if (this._minHeightTimeout) {
         clearTimeout(this._minHeightTimeout);
       }
-      this._minHeightTimeout = setTimeout(() => {
+      this._minHeightTimeout = window.setTimeout(() => {
         if (this.isDisposed) {
           return;
         }