From 4d83353d5a4d35d8ebd204bec06cd33ff9af0f08 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 30 Apr 2014 14:36:11 +0300 Subject: [PATCH] fix stream post --- frontend/client/src/views/stream/panel.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/client/src/views/stream/panel.js b/frontend/client/src/views/stream/panel.js index 7e737c94be..a063e3eb36 100644 --- a/frontend/client/src/views/stream/panel.js +++ b/frontend/client/src/views/stream/panel.js @@ -39,8 +39,8 @@ Espo.define('Views.Stream.Panel', 'Views.Record.Panels.Relationship', function ( this.post(); } else if (e.keyCode == 9) { $text = $(e.currentTarget) - if ($text.val() == '') { - this.$el.find('.buttons-panel').addClass('hide'); + if ($text.val() == '') { + this.disablePostingMode(); } } }, @@ -61,10 +61,8 @@ Espo.define('Views.Stream.Panel', 'Views.Record.Panels.Relationship', function ( this.$el.find('.buttons-panel').removeClass('hide'); if (!this.postingMode) { - $('body').on('click.stream-panel', function (e) { - var $element = $(e.toElement); - if (!$.contains(this.$el.get(0), e.toElement)) { - + $('body').on('click.stream-panel', function (e) { + if (!$.contains(this.$el.get(0), e.target)) { if (this.$textarea.val() == '') { var attachmentsIds = this.seed.get('attachmentsIds'); if (!attachmentsIds.length) {