From 575b7a042e7737dbe09a4f27d645892288813a13 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 16 Feb 2015 14:18:04 +0300 Subject: [PATCH] Fixed scrolling after stickers send Closes #701 --- app/js/directives.js | 11 ++++++++--- app/partials/desktop/message_attach_document.html | 8 +------- app/partials/mobile/message_attach_document.html | 8 +------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/app/js/directives.js b/app/js/directives.js index 132f1e5f..233b519e 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -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']) }); } 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']) }; function link ($scope, element, attrs) { - var imgElement = element; + var imgElement = $('').appendTo(element); var setSrc = function (blob) { if (WebpManager.isWebpSupported()) { @@ -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 = { diff --git a/app/partials/desktop/message_attach_document.html b/app/partials/desktop/message_attach_document.html index d994fb41..5b1412c9 100644 --- a/app/partials/desktop/message_attach_document.html +++ b/app/partials/desktop/message_attach_document.html @@ -2,13 +2,7 @@
-
- -
+
diff --git a/app/partials/mobile/message_attach_document.html b/app/partials/mobile/message_attach_document.html index d994fb41..5b1412c9 100644 --- a/app/partials/mobile/message_attach_document.html +++ b/app/partials/mobile/message_attach_document.html @@ -2,13 +2,7 @@
-
- -
+