From 90df02e10bca7d594c3ee20987cd54ca08611f58 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Sun, 26 Jul 2015 22:01:27 +0300 Subject: [PATCH] Fixed first click after forces Closes #858 --- app/js/controllers.js | 3 ++- app/js/lib/ng_utils.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 228f3ab1..b7d18418 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -1397,7 +1397,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) } function toggleMessage (messageID, $event) { - if ($scope.historyState.startBot) { + if ($scope.historyState.startBot || + $rootScope.idle.afterFocus) { return false; } diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index 77f7cda6..352661de 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -1005,6 +1005,13 @@ angular.module('izhukov.utils', []) }, 30000); } + if (e.type == 'focus' && !$rootScope.idle.afterFocus) { + $rootScope.idle.afterFocus = true; + setTimeout(function () { + delete $rootScope.idle.afterFocus; + }, 10); + } + if ($rootScope.idle.isIDLE == isIDLE) { return; }