Browse Source

Add `refresh` and `focus` methods for code viewers

pull/1359/head
Artur Arseniev 8 years ago
parent
commit
60ca55e600
  1. 18
      src/code_manager/model/CodeMirrorEditor.js

18
src/code_manager/model/CodeMirrorEditor.js

@ -51,6 +51,24 @@ module.exports = Backbone.Model.extend({
return this;
},
/**
* Refresh the viewer
* @return {self}
*/
refresh() {
this.getEditor().refresh();
return this;
},
/**
* Focus the viewer
* @return {self}
*/
focus() {
this.getEditor().focus();
return this;
},
getContent() {
const ed = this.getEditor();
return ed && ed.getValue();

Loading…
Cancel
Save