Skip to content
Snippets Groups Projects
Commit 246f5d2e authored by Emmanuel ROHEE's avatar Emmanuel ROHEE
Browse files

SYWEB-30: BF: When switching between rooms, pagination flickered between the...

SYWEB-30: BF: When switching between rooms, pagination flickered between the top of the room before jumping to the bottom of the page
parent c707b7d1
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ...@@ -32,7 +32,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
can_paginate: false, // this is toggled off when we are not ready yet to paginate or when we run out of items can_paginate: false, // this is toggled off when we are not ready yet to paginate or when we run out of items
paginating: false, // used to avoid concurrent pagination requests pulling in dup contents paginating: false, // used to avoid concurrent pagination requests pulling in dup contents
stream_failure: undefined, // the response when the stream fails stream_failure: undefined, // the response when the stream fails
waiting_for_joined_event: false // true when the join request is pending. Back to false once the corresponding m.room.member event is received waiting_for_joined_event: false, // true when the join request is pending. Back to false once the corresponding m.room.member event is received
messages_visibility: "hidden" // In order to avoid flickering when scrolling down the message table at the page opening, delay the message table display
}; };
$scope.members = {}; $scope.members = {};
$scope.autoCompleting = false; $scope.autoCompleting = false;
...@@ -136,6 +137,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ...@@ -136,6 +137,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
$timeout(function() { $timeout(function() {
objDiv.scrollTop = objDiv.scrollHeight; objDiv.scrollTop = objDiv.scrollHeight;
// Show the message table once the first scrolldown is done
if ("visible" !== $scope.state.messages_visibility) {
$timeout(function() {
$scope.state.messages_visibility = "visible";
}, 0);
}
}, 0); }, 0);
} }
}; };
......
...@@ -56,7 +56,10 @@ ...@@ -56,7 +56,10 @@
</table> </table>
</div> </div>
<div id="messageTableWrapper" ng-hide="state.permission_denied" keep-scroll> <div id="messageTableWrapper"
ng-hide="state.permission_denied"
ng-style="{ 'visibility': state.messages_visibility }"
keep-scroll>
<!-- FIXME: need to have better timestamp semantics than the (msg.content.hsob_ts || msg.ts) hack below --> <!-- FIXME: need to have better timestamp semantics than the (msg.content.hsob_ts || msg.ts) hack below -->
<table id="messageTable" infinite-scroll="paginateMore()"> <table id="messageTable" infinite-scroll="paginateMore()">
<tr ng-repeat="msg in events.rooms[room_id].messages" <tr ng-repeat="msg in events.rooms[room_id].messages"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment