From 9d0b86f54b6361bffe1892038cfb876c3e094349 Mon Sep 17 00:00:00 2001 From: Piotr Dabrowski Date: Fri, 18 Oct 2013 16:18:49 +0200 Subject: [PATCH] [BluetoothChat] updated BluetoothChat sources Change-Id: I835a83bd9554174e84f0d161f38e89328be88311 --- js/app.ui.events.js | 3 +++ js/app.ui.js | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/js/app.ui.events.js b/js/app.ui.events.js index f9ae99f..781c779 100644 --- a/js/app.ui.events.js +++ b/js/app.ui.events.js @@ -166,6 +166,9 @@ function UiEvents(parent) { $('#ui-mySend').on('click', function (event) { event.stopPropagation(); var message = $('#text').val(); + if (message.length === 0) { + return; + } $('#text').val(''); self.ui.disableSendButton(); app.sendMessage(message); diff --git a/js/app.ui.js b/js/app.ui.js index 9bd9d99..9e4f7cc 100644 --- a/js/app.ui.js +++ b/js/app.ui.js @@ -192,13 +192,9 @@ function Ui(callback) { }, disableSendButton: function Ui_disableSendButton() { - setTimeout( function() { - $('#ui-mySend') - .css({'pointer-events': 'none', 'color': '#bbb'}) - .addClass('ui-disabled'); - }, - 0 - ); + $('#ui-mySend') + .css({'pointer-events': 'none', 'color': '#bbb'}) + .addClass('ui-disabled'); }, checkSendButtonState: function Ui_checkSendButtonState() { -- 2.7.4