Browse Source

Merge pull request #1758 from blink1073/fix-markdown-paste

Clean up markdown cell sizing
Afshin Darian 8 years ago
parent
commit
db3ed9280e
2 changed files with 5 additions and 5 deletions
  1. 1 1
      src/cells/widget.ts
  2. 4 4
      src/codeeditor/widget.ts

+ 1 - 1
src/cells/widget.ts

@@ -775,11 +775,11 @@ class InputAreaWidget extends Widget {
    * Show the text editor.
    */
   showEditor(): void {
-    this._editor.show();
     let layout = this.layout as PanelLayout;
     if (this._rendered) {
       layout.removeWidget(this._rendered);
     }
+    this._editor.show();
   }
 
   /**

+ 4 - 4
src/codeeditor/widget.ts

@@ -56,6 +56,7 @@ class CodeEditorWidget extends Widget {
       return;
     }
     clearTimeout(this._resizing);
+    this._resizing = -1;
     super.dispose();
     this._editor.dispose();
     this._editor = null;
@@ -93,10 +94,8 @@ class CodeEditorWidget extends Widget {
    * A message handler invoked on an `'after-show'` message.
    */
   protected onAfterShow(msg: Message): void {
-    if (this._needsRefresh) {
-      this._editor.refresh();
-      this._needsRefresh = false;
-    }
+    this._editor.refresh();
+    this._needsRefresh = false;
   }
 
   /**
@@ -118,6 +117,7 @@ class CodeEditorWidget extends Widget {
       }
     } else {
       this._editor.setSize(msg);
+      this._needsResize = false;
     }
     this._needsRefresh = true;
   }