Skip to content

Commit

Permalink
export Editor to init function
Browse files Browse the repository at this point in the history
  • Loading branch information
chairuosen committed Nov 29, 2016
1 parent 0f8f9c5 commit 232e47b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ module.exports = {
var lang = this.lang||'text';
var theme = this.theme||'chrome';

this.$emit('init');

require('brace/ext/emmet');

var editor = vm.editor = ace.edit(this.$el);

this.$emit('init',editor);

editor.$blockScrolling = Infinity;
editor.setOption("enableEmmet", true);

editor.getSession().setMode('ace/mode/'+lang);
editor.setTheme('ace/theme/'+theme);

editor.setValue(this.value,1);

editor.on('change',function () {
Expand All @@ -60,5 +59,6 @@ module.exports = {
vm.contentBackup = content;
});


}
}

0 comments on commit 232e47b

Please sign in to comment.