Fixed message send
This commit is contained in:
parent
dfa62f90ce
commit
607639a6a8
@ -1377,13 +1377,10 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
||||
$scope.$on('user_update', angular.noop);
|
||||
$scope.$on('ui_typing', onTyping);
|
||||
|
||||
$scope.draftMessage = {text: ''};
|
||||
$scope.draftMessage = {text: '', send: sendMessage};
|
||||
$scope.$watch('draftMessage.text', onMessageChange);
|
||||
$scope.$watch('draftMessage.files', onFilesSelected);
|
||||
|
||||
|
||||
$scope.sendMessage = sendMessage;
|
||||
|
||||
function sendMessage (e) {
|
||||
$scope.$broadcast('ui_message_before_send');
|
||||
|
||||
|
@ -954,7 +954,7 @@ angular.module('myApp.directives', ['myApp.filters'])
|
||||
if (submit) {
|
||||
$timeout.cancel(updatePromise);
|
||||
updateValue();
|
||||
$(element).trigger('submit');
|
||||
$scope.draftMessage.send();
|
||||
$(element).trigger('message_send');
|
||||
resetAfterSubmit();
|
||||
return cancelEvent(e);
|
||||
@ -966,7 +966,7 @@ angular.module('myApp.directives', ['myApp.filters'])
|
||||
$(submitBtn).on('mousedown touchstart', function (e) {
|
||||
$timeout.cancel(updatePromise);
|
||||
updateValue();
|
||||
$(element).trigger('submit');
|
||||
$scope.draftMessage.send();
|
||||
$(element).trigger('message_send');
|
||||
resetAfterSubmit();
|
||||
return cancelEvent(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user