Skip to content

Commit

Permalink
fix send message
Browse files Browse the repository at this point in the history
  • Loading branch information
matiastucci committed Aug 4, 2015
1 parent 2f52940 commit ab52b58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular.module('chat.controllers', [])

if(!$scope.data.username){
var nicknamePopup = $ionicPopup.show({
template: '<input type="text" ng-model="data.username" autofocus>',
template: '<input id="usr-input" type="text" ng-model="data.username" autofocus>',
title: 'What\'s your nickname?',
scope: $scope,
buttons: [{
Expand All @@ -38,6 +38,8 @@ angular.module('chat.controllers', [])

if($stateParams.username){
$scope.data.message = "@" + $stateParams.username;
document.getElementById("usr-input").blur();
document.getElementById("msg-input").focus();
}

var sendUpdateTyping = function(){
Expand Down Expand Up @@ -74,7 +76,7 @@ angular.module('chat.controllers', [])

$scope.sendMessage = function(msg){
Chat.sendMessage(msg);
$scope.input.message = "";
$scope.data.message = "";
};

})
Expand Down

0 comments on commit ab52b58

Please sign in to comment.