diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 8af21c295..3c5063aa7 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -641,6 +641,11 @@ define([ $(document).on('keydown.' + this.cid, this.binding.keydown); var me = this; + + setTimeout(function () { + me.fireEvent('animate:before', me); + }, 10); + if (this.options.animate !== false) { this.$window.css({ '-webkit-transform': 'scale(0.8)', diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js index 8deac95d0..531df2e59 100644 --- a/apps/common/main/lib/view/Comments.js +++ b/apps/common/main/lib/view/Comments.js @@ -473,19 +473,17 @@ define([ }); me.on({ 'show': function () { - - // me.calculateSizeOfContent(); me.commentsView.autoHeightTextBox(); - - var text = me.$window.find('textarea'); - if (text && text.length) - text.focus(); - - text.keydown(function (event) { + me.$window.find('textarea').keydown(function (event) { if (event.keyCode == Common.UI.Keys.ESC) { me.hide(); } }); + }, + 'animate:before': function () { + var text = me.$window.find('textarea'); + if (text && text.length) + text.focus(); } }); }