Search bugfixes

This commit is contained in:
Igor Zhukov 2014-06-14 00:43:31 +04:00
parent cb0201bfaf
commit 4fec64088e

View File

@ -355,6 +355,9 @@ angular.module('myApp.controllers', [])
var prevMessages = false; var prevMessages = false;
$scope.$watchCollection('search', function () { $scope.$watchCollection('search', function () {
if ($scope.search.messages && (!angular.isString($scope.search.query) || !$scope.search.query.length)) {
prevMessages = $scope.search.messages = false;
}
if ($scope.search.messages != prevMessages) { if ($scope.search.messages != prevMessages) {
prevMessages = $scope.search.messages; prevMessages = $scope.search.messages;
$scope.dialogs = []; $scope.dialogs = [];