|
|
@ -1145,7 +1145,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.directive('mySendForm', function ($timeout, $modalStack, $http, $interpolate, Storage, AppStickersManager, ErrorService) { |
|
|
|
.directive('mySendForm', function ($timeout, $compile, $modalStack, $http, $interpolate, Storage, AppStickersManager, ErrorService) { |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
link: link, |
|
|
|
link: link, |
|
|
@ -1195,6 +1195,9 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var peerPhotoCompiled = $compile('<span class="composer_user_photo" my-peer-photolink="peerID" img-class="composer_user_photo"></span>'); |
|
|
|
|
|
|
|
var cachedPeerPhotos = {}; |
|
|
|
|
|
|
|
|
|
|
|
var composer = new MessageComposer(messageField, { |
|
|
|
var composer = new MessageComposer(messageField, { |
|
|
|
onTyping: function () { |
|
|
|
onTyping: function () { |
|
|
|
$scope.$emit('ui_typing'); |
|
|
|
$scope.$emit('ui_typing'); |
|
|
@ -1202,6 +1205,18 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
getSendOnEnter: function () { |
|
|
|
getSendOnEnter: function () { |
|
|
|
return sendOnEnter; |
|
|
|
return sendOnEnter; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
getPeerImage: function (element, peerID) { |
|
|
|
|
|
|
|
if (cachedPeerPhotos[peerID]) { |
|
|
|
|
|
|
|
element.replaceWith(cachedPeerPhotos[peerID]); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var scope = $scope.$new(true); |
|
|
|
|
|
|
|
scope.peerID = peerID; |
|
|
|
|
|
|
|
peerPhotoCompiled(scope, function (clonedElement) { |
|
|
|
|
|
|
|
cachedPeerPhotos[peerID] = clonedElement; |
|
|
|
|
|
|
|
element.replaceWith(clonedElement); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
mentions: $scope.mentions, |
|
|
|
mentions: $scope.mentions, |
|
|
|
onMessageSubmit: onMessageSubmit, |
|
|
|
onMessageSubmit: onMessageSubmit, |
|
|
|
onFilePaste: onFilePaste |
|
|
|
onFilePaste: onFilePaste |
|
|
|