From 2302442e1a7f0fc58692e360172e515ad19fcc55 Mon Sep 17 00:00:00 2001 From: Kane York Date: Thu, 9 Jul 2015 13:25:33 -0700 Subject: [PATCH] Add ace:resize app event For discourse-data-explorer --- .../javascripts/admin/components/ace-editor.js.es6 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/assets/javascripts/admin/components/ace-editor.js.es6 b/app/assets/javascripts/admin/components/ace-editor.js.es6 index d1813bcf3..22a48685e 100644 --- a/app/assets/javascripts/admin/components/ace-editor.js.es6 +++ b/app/assets/javascripts/admin/components/ace-editor.js.es6 @@ -26,8 +26,15 @@ export default Ember.Component.extend({ this._editor.destroy(); this._editor = null; } + this.appEvents.off('ace:resize', this, this.resize); }.on('willDestroyElement'), + resize() { + if (this._editor) { + this._editor.resize(); + } + }, + _initEditor: function() { const self = this; @@ -43,9 +50,11 @@ export default Ember.Component.extend({ self.set('content', editor.getSession().getValue()); self._skipContentChangeEvent = false; }); + editor.$blockScrolling = Infinity; self.$().data('editor', editor); self._editor = editor; + self.appEvents.on('ace:resize', self, self.resize); }); });