|
|
@ -888,7 +888,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
if (options.idleScroll) { |
|
|
|
if (options.idleScroll) { |
|
|
|
onContentLoaded(function () { |
|
|
|
onContentLoaded(function () { |
|
|
|
$(historyWrap).nanoScroller(); |
|
|
|
$(historyWrap).nanoScroller(); |
|
|
|
changeScroll(); |
|
|
|
changeScroll(true); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -929,11 +929,12 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function changeScroll () { |
|
|
|
function changeScroll (noFocus) { |
|
|
|
var unreadSplit, focusMessage; |
|
|
|
var unreadSplit, focusMessage; |
|
|
|
|
|
|
|
|
|
|
|
// console.trace('change scroll');
|
|
|
|
// console.trace('change scroll');
|
|
|
|
if (focusMessage = $('.im_message_focus:visible', scrollableWrap)[0]) { |
|
|
|
if (!noFocus && |
|
|
|
|
|
|
|
(focusMessage = $('.im_message_focus:visible', scrollableWrap)[0])) { |
|
|
|
var ch = scrollableWrap.clientHeight, |
|
|
|
var ch = scrollableWrap.clientHeight, |
|
|
|
st = scrollableWrap.scrollTop, |
|
|
|
st = scrollableWrap.scrollTop, |
|
|
|
ot = focusMessage.offsetTop, |
|
|
|
ot = focusMessage.offsetTop, |
|
|
@ -979,6 +980,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('ui_history_focus', function () { |
|
|
|
$scope.$on('ui_history_focus', function () { |
|
|
|
if (!atBottom) { |
|
|
|
if (!atBottom) { |
|
|
|
|
|
|
|
// console.log(dT(), 'scroll history focus');
|
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
updateScroller(); |
|
|
|
updateScroller(); |
|
|
|
atBottom = true; |
|
|
|
atBottom = true; |
|
|
@ -1124,6 +1126,7 @@ angular.module('myApp.directives', ['myApp.filters']) |
|
|
|
if (heightOnly === true) return; |
|
|
|
if (heightOnly === true) return; |
|
|
|
if (atBottom) { |
|
|
|
if (atBottom) { |
|
|
|
onContentLoaded(function () { |
|
|
|
onContentLoaded(function () { |
|
|
|
|
|
|
|
// console.log('change scroll bottom');
|
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
scrollableWrap.scrollTop = scrollableWrap.scrollHeight; |
|
|
|
updateScroller(); |
|
|
|
updateScroller(); |
|
|
|
}); |
|
|
|
}); |
|
|
|