diff --git a/app/css/app.css b/app/css/app.css index c16ce53f..67f66afc 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1630,8 +1630,9 @@ span.emoji { .im_history_empty { text-align: center; color: #999; - font-size: 1.5em; - padding: 0 50px; + font-size: 18px; + line-height: 18px; + padding: 1px 50px; } .im_history_to_bottom .im_history_not_selected, .im_history_to_bottom .im_history_empty { diff --git a/app/js/controllers.js b/app/js/controllers.js index edb54852..a7063577 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -431,6 +431,7 @@ angular.module('myApp.controllers', []) var peerData = AppPeersManager.getPeer(peerID); // console.log('update', preload, peerData); if (!peerData || peerData.deleted) { + safeReplaceObject($scope.state, {loaded: false}); return false; } @@ -523,10 +524,8 @@ angular.module('myApp.controllers', []) : AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID); - safeReplaceObject($scope.state, {loaded: false}); + $scope.state.mayBeHasMore = true; getMessagesPromise.then(function (historyResult) { - safeReplaceObject($scope.state, {loaded: true}); - if (curJump != jump) return; offset += historyResult.history.length; @@ -535,6 +534,8 @@ angular.module('myApp.controllers', []) maxID = historyResult.history[historyResult.history.length - 1]; updateHistoryPeer(); + safeReplaceObject($scope.state, {loaded: true}); + angular.forEach(historyResult.history, function (id) { $scope.history.push(AppMessagesManager.wrapForHistory(id)); }); diff --git a/app/js/directives.js b/app/js/directives.js index 1d71d20f..601a4925 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -298,6 +298,9 @@ angular.module('myApp.directives', ['myApp.filters']) }); $scope.$on('ui_editor_resize', updateSizes); + $scope.$on('ui_height', function () { + updateSizes(); + }); var atBottom = true; $(scrollableWrap).on('scroll', function (e) { @@ -1016,6 +1019,8 @@ angular.module('myApp.directives', ['myApp.filters']) function link($scope, element, attrs) { + var prevMargin = false; + var updateMargin = function () { var height = element[0].offsetHeight, contHeight = $($window).height(), @@ -1023,6 +1028,12 @@ angular.module('myApp.directives', ['myApp.filters']) margin = height < contHeight ? parseInt((contHeight - height) * ratio) : ''; element.css({marginTop: margin, marginBottom: margin}); + + if (prevMargin !== margin) { + $scope.$emit('ui_height'); + } + + prevMargin = margin; }; onContentLoaded(updateMargin); @@ -1033,6 +1044,8 @@ angular.module('myApp.directives', ['myApp.filters']) onContentLoaded(updateMargin); }); + + }; }) diff --git a/app/partials/im.html b/app/partials/im.html index ecf72649..93c77d18 100644 --- a/app/partials/im.html +++ b/app/partials/im.html @@ -59,10 +59,10 @@