Skip to content

Commit

Permalink
Decouple from global CodeMirror object
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeche committed Mar 5, 2015
1 parent bf2edf9 commit f96e723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions dist/movie.js
Expand Up @@ -633,15 +633,10 @@ function parseMovieDefinition(text) {
editorOptions: editorOptions
};
}
// XXX add 'revert' action to CodeMirror to restore original text and position
CodeMirror.commands.revert = function (editor) {
if (editor.__initial) {
editor.setValue(editor.__initial.content);
editor.setCursor(editor.__initial.pos);
}
};

CodeMirror.movie = movie;
if (typeof CodeMirror !== "undefined") {
CodeMirror.movie = movie;
}
Object.defineProperty(exports, "__esModule", {
value: true
});
Expand Down
11 changes: 3 additions & 8 deletions lib/movie.js
Expand Up @@ -277,12 +277,7 @@ function parseMovieDefinition(text, options={}) {
editorOptions: editorOptions
};
}
// XXX add 'revert' action to CodeMirror to restore original text and position
CodeMirror.commands.revert = function(editor) {
if (editor.__initial) {
editor.setValue(editor.__initial.content);
editor.setCursor(editor.__initial.pos);
}
};

CodeMirror.movie = movie;
if (typeof CodeMirror !== 'undefined') {
CodeMirror.movie = movie;
}

0 comments on commit f96e723

Please sign in to comment.