Fixed scrolling after stickers send

Closes #701
This commit is contained in:
Igor Zhukov 2015-02-16 14:18:04 +03:00
parent d1303726a4
commit 575b7a042e
3 changed files with 10 additions and 17 deletions

View File

@ -814,7 +814,8 @@ angular.module('myApp.directives', ['myApp.filters'])
if (curAnimated) { if (curAnimated) {
wasH = scrollableWrap.scrollHeight; wasH = scrollableWrap.scrollHeight;
} else { } else {
$(scrollable).css({bottom: 0}); var pr = parseInt($(scrollableWrap).css('paddingRight'))
$(scrollable).css({bottom: 0, paddingRight: pr});
$(scrollableWrap).addClass('im_history_to_bottom'); $(scrollableWrap).addClass('im_history_to_bottom');
} }
@ -835,7 +836,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}); });
} else { } else {
$(scrollableWrap).removeClass('im_history_to_bottom'); $(scrollableWrap).removeClass('im_history_to_bottom');
$(scrollable).css({bottom: ''}); $(scrollable).css({bottom: '', paddingRight: 0});
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; scrollableWrap.scrollTop = scrollableWrap.scrollHeight;
updateBottomizer(); updateBottomizer();
} }
@ -1599,7 +1600,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}; };
function link ($scope, element, attrs) { function link ($scope, element, attrs) {
var imgElement = element; var imgElement = $('<img />').appendTo(element);
var setSrc = function (blob) { var setSrc = function (blob) {
if (WebpManager.isWebpSupported()) { if (WebpManager.isWebpSupported()) {
@ -1615,6 +1616,10 @@ angular.module('myApp.directives', ['myApp.filters'])
width: $scope.document.thumb.width, width: $scope.document.thumb.width,
height: $scope.document.thumb.height height: $scope.document.thumb.height
}); });
element.css({
width: $scope.document.thumb.width,
height: $scope.document.thumb.height
});
var smallLocation = $scope.document.thumb.location; var smallLocation = $scope.document.thumb.location;
var fullLocation = { var fullLocation = {

View File

@ -2,13 +2,7 @@
<div ng-switch-when="gif" my-load-gif document="document"></div> <div ng-switch-when="gif" my-load-gif document="document"></div>
<div ng-switch-when="sticker"> <div ng-switch-when="sticker" my-load-sticker document="document"></div>
<img
class="im_message_sticker"
my-load-sticker
document="document"
/>
</div>
<div ng-switch-when="audio" class="im_message_audio"> <div ng-switch-when="audio" class="im_message_audio">
<div my-audio-player audio="document"></div> <div my-audio-player audio="document"></div>

View File

@ -2,13 +2,7 @@
<div ng-switch-when="gif" my-load-gif document="document"></div> <div ng-switch-when="gif" my-load-gif document="document"></div>
<div ng-switch-when="sticker"> <div ng-switch-when="sticker" my-load-sticker document="document"></div>
<img
class="im_message_sticker"
my-load-sticker
document="document"
/>
</div>
<div ng-switch-when="audio" class="im_message_audio"> <div ng-switch-when="audio" class="im_message_audio">
<div my-audio-player audio="document"></div> <div my-audio-player audio="document"></div>