From d9f13fe09e4adc52bdf64533f8d4b0cdceaf2956 Mon Sep 17 00:00:00 2001
From: Rene Saarsoo <nene@triin.net>
Date: Thu, 10 May 2012 12:08:24 +0300
Subject: [PATCH] Another fix for CodeMirror initial height.

The hight now gets set to the right size the first time the editor is
activated.
---
 template/app/view/examples/Inline.js       | 1 +
 template/app/view/examples/InlineEditor.js | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/template/app/view/examples/Inline.js b/template/app/view/examples/Inline.js
index 8a822b87..89b58c29 100644
--- a/template/app/view/examples/Inline.js
+++ b/template/app/view/examples/Inline.js
@@ -72,6 +72,7 @@ Ext.define('Docs.view.examples.Inline', {
                 cmpName: 'code',
                 value: this.value,
                 listeners: {
+                    init: this.updateHeight,
                     change: this.updateHeight,
                     scope: this
                 }
diff --git a/template/app/view/examples/InlineEditor.js b/template/app/view/examples/InlineEditor.js
index ed92f6fe..aa125f9e 100644
--- a/template/app/view/examples/InlineEditor.js
+++ b/template/app/view/examples/InlineEditor.js
@@ -9,6 +9,11 @@ Ext.define('Docs.view.examples.InlineEditor', {
 
     initComponent: function() {
         this.addEvents(
+            /**
+             * @event
+             * Fired after CodeMirror initialized.
+             */
+            "init",
             /**
              * @event
              * Fired when CodeMirror onChange is called.
@@ -29,6 +34,7 @@ Ext.define('Docs.view.examples.InlineEditor', {
                     this.fireEvent("change");
                 }, this)
             });
+            this.fireEvent("init");
         }
     },
 
-- 
GitLab