From 3ec413ec283fc2f730db883955b12bc63ad2681a Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 3 Feb 2014 22:56:30 +0400 Subject: [PATCH] Improved typing perfomance --- app/js/directives.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/js/directives.js b/app/js/directives.js index c719de02..3d836d90 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -202,11 +202,11 @@ angular.module('myApp.directives', ['myApp.filters']) scope.$on('ui_editor_change', function (e, data) { if (data.start) { if (!$(sendPanelWrap).hasClass('im_panel_fixed_bottom')) { - $(sendFormWrap1).css({height: $(sendFormWrap).height()}); + sendFormWrap1.style.height = sendFormWrap.offsetHeight + 'px'; $(sendPanelWrap).addClass('im_panel_fixed_bottom'); } } else { - $(sendFormWrap1).css({height: 'auto'}); + sendFormWrap1.style.height = 'auto'; $(sendPanelWrap).removeClass('im_panel_fixed_bottom'); } }); @@ -237,7 +237,7 @@ angular.module('myApp.directives', ['myApp.filters']) minHeight: $($window).height() - panelWrap.offsetHeight - sendPanelWrap.offsetHeight - 90 - 44 }); - if (heightOnly) return; + if (heightOnly == true) return; if (atBottom) { onContentLoaded(function () { scrollableWrap.scrollTop = scrollableWrap.scrollHeight; @@ -356,11 +356,12 @@ angular.module('myApp.directives', ['myApp.filters']) } } - var height = $(richTextarea).height(); + var height = richTextarea.offsetHeight; function updateHeight () { - var newHeight = $(richTextarea).height(); + var newHeight = richTextarea.offsetHeight; if (height != newHeight) { height = newHeight; + scope.$emit('ui_editor_change', {start: false}); scope.$emit('ui_editor_resize'); } };