|
|
@ -149,7 +149,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.directive('myHistory', function ($window, $timeout) { |
|
|
|
.directive('myHistory', function ($window, $timeout, $transition) { |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
link: link |
|
|
|
link: link |
|
|
@ -199,9 +199,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
if (!atBottom && !options.my) { |
|
|
|
if (!atBottom && !options.my) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (animated) { |
|
|
|
if (!animated) { |
|
|
|
$(scrollableWrap).stop(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$(scrollable).css({bottom: 0}); |
|
|
|
$(scrollable).css({bottom: 0}); |
|
|
|
$(scrollableWrap).addClass('im_history_to_bottom'); |
|
|
|
$(scrollableWrap).addClass('im_history_to_bottom'); |
|
|
|
} |
|
|
|
} |
|
|
@ -213,22 +211,22 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
$(historyMessagesEl).removeClass('im_history_appending'); |
|
|
|
$(historyMessagesEl).removeClass('im_history_appending'); |
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
$(historyMessagesEl).css(transform, 'translate(0px, ' + (scrollableWrap.scrollHeight - wasH) + 'px)'); |
|
|
|
$(historyMessagesEl).css(transform, 'translate(0px, ' + (scrollableWrap.scrollHeight - wasH) + 'px)'); |
|
|
|
setTimeout(function () { |
|
|
|
$(historyWrap).nanoScroller(); |
|
|
|
$(historyMessagesEl).addClass('im_history_appending'); |
|
|
|
var styles = {}; |
|
|
|
$(historyMessagesEl).css(transform, 'translate(0px, 0px)'); |
|
|
|
styles[transform] = 'translate(0px, 0px)'; |
|
|
|
setTimeout(function () { |
|
|
|
$(historyMessagesEl).addClass('im_history_appending'); |
|
|
|
curAnimation = false; |
|
|
|
$transition($(historyMessagesEl), styles).then(function () { |
|
|
|
$(historyMessagesEl).removeClass('im_history_appending'); |
|
|
|
curAnimation = false; |
|
|
|
updateBottomizer(); |
|
|
|
$(historyMessagesEl).removeClass('im_history_appending'); |
|
|
|
}, 300); |
|
|
|
updateBottomizer(); |
|
|
|
}, 0); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$(scrollableWrap).removeClass('im_history_to_bottom'); |
|
|
|
$(scrollableWrap).removeClass('im_history_to_bottom'); |
|
|
|
$(scrollable).css({bottom: ''}); |
|
|
|
$(scrollable).css({bottom: ''}); |
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
updateBottomizer(); |
|
|
|
updateBottomizer(); |
|
|
|
|
|
|
|
$(historyWrap).nanoScroller(); |
|
|
|
} |
|
|
|
} |
|
|
|
$(historyWrap).nanoScroller(); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|