Skip to content

Commit

Permalink
Update detach function in monaco-adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjaltale16 committed Jun 6, 2018
1 parent 0690042 commit 9b4880e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/monaco-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ firepad.MonacoAdapter = (function() {
this.monacoModel = this.monaco.getModel();

this.grabDocumentState();
this.monaco.onDidChangeModelContent(this.onChange);
this.monaco.onDidBlurEditor(this.onBlur);
this.monaco.onDidFocusEditor(this.onFocus);
this.monaco.onDidChangeCursorPosition(this.onCursorActivity);
var changeHandler = this.monaco.onDidChangeModelContent(this.onChange);
var didBlurHandler = this.monaco.onDidBlurEditor(this.onBlur);
var didFocusHandler = this.monaco.onDidFocusEditor(this.onFocus);
var didChangeCursorPositionHandler = this.monaco.onDidChangeCursorPosition(this.onCursorActivity);
}

MonacoAdapter.prototype.grabDocumentState = function() {
Expand All @@ -23,10 +23,10 @@ firepad.MonacoAdapter = (function() {
};

MonacoAdapter.prototype.detach = function() {
this.onChange.dispose();
this.onBlur.dispose();
this.onFocus.dispose();
this.onCursorActivity.dispose();
changeHandler.dispose();
didBlurHandler.dispose();
didFocusHandler.dispose();
didChangeCursorPositionHandler.dispose();
};

MonacoAdapter.prototype.onChange = function(change) {
Expand Down

0 comments on commit 9b4880e

Please sign in to comment.