Fixed mobile prepend history

This commit is contained in:
Igor Zhukov 2014-09-19 20:01:50 +04:00
parent f1cb4d3957
commit a5609dbdf3

View File

@ -201,13 +201,14 @@ angular.module('myApp.directives')
pr = parseInt($(scrollableWrap).css('paddingRight')), pr = parseInt($(scrollableWrap).css('paddingRight')),
ch = scrollableWrap.clientHeight; ch = scrollableWrap.clientHeight;
$(scrollable).css({marginBottom: -(sh - st - ch - 4), marginLeft: -Math.ceil(pr / 2)});
$(scrollableWrap).addClass('im_history_to_bottom'); $(scrollableWrap).addClass('im_history_to_bottom');
scrollableWrap.scrollHeight; // Some strange Chrome bug workaround
$(scrollable).css({bottom: -(sh - st - ch), marginLeft: -Math.ceil(pr / 2)});
var upd = function () { var upd = function () {
$(scrollableWrap).removeClass('im_history_to_bottom'); $(scrollableWrap).removeClass('im_history_to_bottom');
$(scrollable).css({marginBottom: '', marginLeft: ''}); $(scrollable).css({bottom: '', marginLeft: ''});
if (scrollTopInitial >= 0) { if (scrollTopInitial >= 0) {
changeScroll(); changeScroll();
} else { } else {