Skip to content

Commit 2302442

Browse files
committed
Add ace:resize app event
For discourse-data-explorer
1 parent 46b6162 commit 2302442

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/assets/javascripts/admin/components/ace-editor.js.es6

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ export default Ember.Component.extend({
2626
this._editor.destroy();
2727
this._editor = null;
2828
}
29+
this.appEvents.off('ace:resize', this, this.resize);
2930
}.on('willDestroyElement'),
3031

32+
resize() {
33+
if (this._editor) {
34+
this._editor.resize();
35+
}
36+
},
37+
3138
_initEditor: function() {
3239
const self = this;
3340

@@ -43,9 +50,11 @@ export default Ember.Component.extend({
4350
self.set('content', editor.getSession().getValue());
4451
self._skipContentChangeEvent = false;
4552
});
53+
editor.$blockScrolling = Infinity;
4654

4755
self.$().data('editor', editor);
4856
self._editor = editor;
57+
self.appEvents.on('ace:resize', self, self.resize);
4958
});
5059
});
5160

0 commit comments

Comments
 (0)