From 2dcaa17d85112ca4a3486992409558d2fcdf6acb Mon Sep 17 00:00:00 2001 From: Misha Peshekhonov Date: Sun, 2 Mar 2014 22:00:45 +0200 Subject: [PATCH 1/2] notice, if there are no messages --- app/css/app.css | 15 ++++++++++++++- app/js/controllers.js | 2 ++ app/partials/im.html | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/css/app.css b/app/css/app.css index 48d16be0..dba0d30b 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -792,6 +792,19 @@ a.im_dialog:hover .im_dialog_date { -webkit-user-select: text; } +.im_history_messages_none.ng-hide { + display: none; +} + +.im_history_messages_none { + display: block; + padding: 100px 50px 0; + + text-align: center; + color: #999; + font-size: 1.5em; +} + .im_history_to_bottom { position: relative; } @@ -2286,4 +2299,4 @@ a.contacts_modal_contact:hover .contacts_modal_contact_status { } .peer_select_modal_wrap .modal-body { padding: 10px 10px 15px; -} \ No newline at end of file +} diff --git a/app/js/controllers.js b/app/js/controllers.js index 0545bbd0..ec7cda06 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -449,6 +449,8 @@ angular.module('myApp.controllers', []) getMessagesPromise.then(function (historyResult) { if (curJump != jump) return; + historyResult.count === 0 ? $scope.mediaEmpty = true : $scope.mediaEmpty = false; + offset += startLimit; hasMore = offset < historyResult.count; maxID = historyResult.history[historyResult.history.length - 1]; diff --git a/app/partials/im.html b/app/partials/im.html index 36f23b90..6dd6337e 100644 --- a/app/partials/im.html +++ b/app/partials/im.html @@ -98,6 +98,7 @@
+
No messages to display
From af109eea13c25bd8c699568f961b1a9e24fe93c1 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 12 Mar 2014 23:29:36 +0100 Subject: [PATCH 2/2] Fixed empty history state --- app/js/controllers.js | 5 ++++- app/partials/im.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index ec7cda06..38d92525 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -335,6 +335,7 @@ angular.module('myApp.controllers', []) StatusManager.start(); $scope.history = []; + $scope.historyEmpty = false; $scope.mediaType = false; $scope.selectedMsgs = {}; $scope.selectedCount = 0; @@ -446,10 +447,12 @@ angular.module('myApp.controllers', []) ? AppMessagesManager.getSearch($scope.curDialog.inputPeer, '', inputMediaFilter, maxID, startLimit) : AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID, startLimit); + $scope.historyEmpty = false; + getMessagesPromise.then(function (historyResult) { if (curJump != jump) return; - historyResult.count === 0 ? $scope.mediaEmpty = true : $scope.mediaEmpty = false; + $scope.historyEmpty = !historyResult.count; offset += startLimit; hasMore = offset < historyResult.count; diff --git a/app/partials/im.html b/app/partials/im.html index 6dd6337e..ce98ca0c 100644 --- a/app/partials/im.html +++ b/app/partials/im.html @@ -98,7 +98,7 @@
-
No messages to display
+
No messages to display