From a72400d3b32e4ff701672e505a4db7a4fc011540 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 17 Mar 2015 22:07:28 +0300 Subject: [PATCH] Fixed scroll to unread when idle --- app/js/controllers.js | 2 +- app/js/directives.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 254269b8..ea93fe2b 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -1413,7 +1413,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.historyState.typing.splice(0, $scope.historyState.typing.length); $scope.$broadcast('ui_history_append_new', { my: addedMessage.my, - noScroll: unreadAfterIdle && !historyMessage.out && $rootScope.idle.isIDLE + idleScroll: unreadAfterIdle && !historyMessage.out && $rootScope.idle.isIDLE }); if (addedMessage.my && $scope.historyUnreadAfter) { delete $scope.historyUnreadAfter; diff --git a/app/js/directives.js b/app/js/directives.js index 3634825f..92794c5f 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -872,10 +872,17 @@ angular.module('myApp.directives', ['myApp.filters']) curAnimation = false; $scope.$on('ui_history_append_new', function (e, options) { - if (!atBottom && !options.my || options.noScroll) { + if (!atBottom && !options.my) { onContentLoaded(function () { $(historyWrap).nanoScroller(); - }) + }); + return; + } + if (options.idleScroll) { + onContentLoaded(function () { + $(historyWrap).nanoScroller(); + changeScroll(); + }); return; } var curAnimated = animated &&