Browse Source

Fixed scrolling after stickers send

Closes #701
master
Igor Zhukov 10 years ago
parent
commit
575b7a042e
  1. 11
      app/js/directives.js
  2. 8
      app/partials/desktop/message_attach_document.html
  3. 8
      app/partials/mobile/message_attach_document.html

11
app/js/directives.js

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

8
app/partials/desktop/message_attach_document.html

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

8
app/partials/mobile/message_attach_document.html

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

Loading…
Cancel
Save