wrap resizing in document ready function

This commit is contained in:
Mario Vavti 2017-02-09 12:01:55 +01:00
parent 8dc349caac
commit 242eede258

View File

@ -5,10 +5,12 @@
var noteSaveTimer = null; var noteSaveTimer = null;
var noteText = $('#note-text'); var noteText = $('#note-text');
noteText.on('change keyup keydown paste cut', function () { $(document).ready(function(e){
$(this).height(0).height(this.scrollHeight); noteText.on('change keyup keydown paste cut', function () {
$(document.body).trigger("sticky_kit:recalc"); noteText.height(0).height(noteText[0].scrollHeight);
}).change(); $(document.body).trigger("sticky_kit:recalc");
}).change();
});
$(document).on('focusout',"#note-text",function(e){ $(document).on('focusout',"#note-text",function(e){
if(noteSaveTimer) if(noteSaveTimer)