Debounce $scope updates when typing in chat. (#8485)

Fixes #6462, by saving a bunch of time per frame. See the issue for evidence of
the win.
This commit is contained in:
Matt Handley
2017-02-27 12:19:42 -06:00
committed by Keith Holliday
parent 6d0df78441
commit 705a78e835
5 changed files with 80 additions and 11 deletions

View File

@@ -60,12 +60,6 @@ habitrpg.controller('ChatCtrl', ['$scope', 'Groups', 'Chat', 'User', '$http', 'A
});
}
$scope.keyDownListener = function (e) {
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
$scope.postChat($scope.group, $scope.message.content);
}
};
$scope.deleteChatMessage = function(group, message){
if(message.uuid === User.user.id || (User.user.backer && User.user.contributor.admin)){
var previousMsg = (group.chat && group.chat[0]) ? group.chat[0].id : false;