From 5a14a4f92612477dd53b10b46f60e26a234ea3e6 Mon Sep 17 00:00:00 2001 From: John Yong Date: Thu, 6 Apr 2017 15:47:09 +0800 Subject: [PATCH 1/2] Scroll chat to bottom upon dialog double click --- app/js/controllers.js | 4 ++++ app/partials/desktop/dialog.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 87d08cf2..84c2ccc6 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -603,6 +603,10 @@ angular.module('myApp.controllers', ['myApp.i18n']) $rootScope.$broadcast('history_focus', params) } + $scope.scrollChatToBottom = function () { + $scope.$broadcast('ui_history_change_scroll', true) + } + $scope.logOut = function () { ErrorService.confirm({type: 'LOGOUT'}).then(function () { MtpApiManager.logOut().then(function () { diff --git a/app/partials/desktop/dialog.html b/app/partials/desktop/dialog.html index 5d4b6536..fe001360 100644 --- a/app/partials/desktop/dialog.html +++ b/app/partials/desktop/dialog.html @@ -1,4 +1,4 @@ - +
From 81f041780ec3baddd84db6b41b36b7cb88ae96a0 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 13 Apr 2017 16:52:41 +0300 Subject: [PATCH 2/2] Simplified double click --- app/js/controllers.js | 6 +----- app/partials/desktop/dialog.html | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 84c2ccc6..8b0298f5 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -456,7 +456,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) var pendingAttachment = false $scope.$on('history_focus', function (e, peerData) { if (peerData.peerString == $scope.curDialog.peer && - peerData.messageID == $scope.curDialog.messageID && + (peerData.messageID ? peerData.messageID == $scope.curDialog.messageID : !$scope.curDialog.messageID) && !peerData.startParam) { if (peerData.messageID) { $scope.$broadcast('ui_history_change_scroll', true) @@ -603,10 +603,6 @@ angular.module('myApp.controllers', ['myApp.i18n']) $rootScope.$broadcast('history_focus', params) } - $scope.scrollChatToBottom = function () { - $scope.$broadcast('ui_history_change_scroll', true) - } - $scope.logOut = function () { ErrorService.confirm({type: 'LOGOUT'}).then(function () { MtpApiManager.logOut().then(function () { diff --git a/app/partials/desktop/dialog.html b/app/partials/desktop/dialog.html index fe001360..5d4b6536 100644 --- a/app/partials/desktop/dialog.html +++ b/app/partials/desktop/dialog.html @@ -1,4 +1,4 @@ -
+