Hide/Show Optimization with #group-pm-list.

The #group-pm-list now only should change state from hidden to
displayed once, which removes time spent recalculating styles in the
DOM.
This commit is contained in:
Brock Whittaker 2017-01-04 10:34:55 -08:00 committed by Tim Abbott
parent a2ebb066b4
commit e7687bff6f
2 changed files with 6 additions and 2 deletions

View File

@ -330,11 +330,11 @@ function actually_update_users_for_search() {
var update_users_for_search = _.throttle(actually_update_users_for_search, 50); var update_users_for_search = _.throttle(actually_update_users_for_search, 50);
function show_huddles() { function show_huddles() {
$('#group-pm-list').expectOne().show(); $('#group-pm-list').addClass("show");
} }
function hide_huddles() { function hide_huddles() {
$('#group-pm-list').expectOne().hide(); $('#group-pm-list').removeClass("show");
} }
exports.update_huddles = function () { exports.update_huddles = function () {

View File

@ -191,6 +191,10 @@
display: none; display: none;
} }
#group-pm-list.show {
display: block;
}
#userlist-header, #userlist-header,
#group-pm-header { #group-pm-header {
border-top: 1px solid #e2e2e2; border-top: 1px solid #e2e2e2;