From 242eede258d47fe6f60d627f54cfb4ea82a71982 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 9 Feb 2017 12:01:55 +0100 Subject: wrap resizing in document ready function --- view/tpl/notes.tpl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl index c4da3783b..c6d5d8a73 100644 --- a/view/tpl/notes.tpl +++ b/view/tpl/notes.tpl @@ -5,10 +5,12 @@ var noteSaveTimer = null; var noteText = $('#note-text'); - noteText.on('change keyup keydown paste cut', function () { - $(this).height(0).height(this.scrollHeight); - $(document.body).trigger("sticky_kit:recalc"); - }).change(); + $(document).ready(function(e){ + noteText.on('change keyup keydown paste cut', function () { + noteText.height(0).height(noteText[0].scrollHeight); + $(document.body).trigger("sticky_kit:recalc"); + }).change(); + }); $(document).on('focusout',"#note-text",function(e){ if(noteSaveTimer) -- cgit v1.2.3