mirror of https://github.com/zulip/zulip.git
buddy_list: Refactor section toggle to not need custom classname.
This commit is contained in:
parent
f29083f2ef
commit
ec1b265ff8
|
@ -452,7 +452,6 @@ export class BuddyList extends BuddyListConf {
|
|||
id: "buddy-list-participants-section-heading",
|
||||
header_text: $t({defaultMessage: "In this conversation"}),
|
||||
user_count: get_formatted_sub_count(this.participant_user_ids.length),
|
||||
toggle_class: "toggle-participants",
|
||||
is_collapsed: this.participants_is_collapsed,
|
||||
}),
|
||||
),
|
||||
|
@ -466,7 +465,6 @@ export class BuddyList extends BuddyListConf {
|
|||
user_count: get_formatted_sub_count(
|
||||
total_human_subscribers_count - this.participant_user_ids.length,
|
||||
),
|
||||
toggle_class: "toggle-users-matching-view",
|
||||
is_collapsed: this.users_matching_view_is_collapsed,
|
||||
}),
|
||||
),
|
||||
|
@ -478,7 +476,6 @@ export class BuddyList extends BuddyListConf {
|
|||
id: "buddy-list-other-users-section-heading",
|
||||
header_text: $t({defaultMessage: "Others"}),
|
||||
user_count: get_formatted_sub_count(other_users_count),
|
||||
toggle_class: "toggle-other-users",
|
||||
is_collapsed: this.other_users_is_collapsed,
|
||||
}),
|
||||
),
|
||||
|
@ -491,11 +488,11 @@ export class BuddyList extends BuddyListConf {
|
|||
"collapsed",
|
||||
this.participants_is_collapsed,
|
||||
);
|
||||
$("#buddy-list-participants-container .toggle-participants").toggleClass(
|
||||
$("#buddy-list-participants-container .buddy-list-section-toggle").toggleClass(
|
||||
"rotate-icon-down",
|
||||
!this.participants_is_collapsed,
|
||||
);
|
||||
$("#buddy-list-participants-container .toggle-participants").toggleClass(
|
||||
$("#buddy-list-participants-container .buddy-list-section-toggle").toggleClass(
|
||||
"rotate-icon-right",
|
||||
this.participants_is_collapsed,
|
||||
);
|
||||
|
@ -511,11 +508,11 @@ export class BuddyList extends BuddyListConf {
|
|||
"collapsed",
|
||||
this.users_matching_view_is_collapsed,
|
||||
);
|
||||
$("#buddy-list-users-matching-view-container .toggle-users-matching-view").toggleClass(
|
||||
$("#buddy-list-users-matching-view-container .buddy-list-section-toggle").toggleClass(
|
||||
"rotate-icon-down",
|
||||
!this.users_matching_view_is_collapsed,
|
||||
);
|
||||
$("#buddy-list-users-matching-view-container .toggle-users-matching-view").toggleClass(
|
||||
$("#buddy-list-users-matching-view-container .buddy-list-section-toggle").toggleClass(
|
||||
"rotate-icon-right",
|
||||
this.users_matching_view_is_collapsed,
|
||||
);
|
||||
|
@ -531,11 +528,11 @@ export class BuddyList extends BuddyListConf {
|
|||
"collapsed",
|
||||
this.other_users_is_collapsed,
|
||||
);
|
||||
$("#buddy-list-other-users-container .toggle-other-users").toggleClass(
|
||||
$("#buddy-list-other-users-container .buddy-list-section-toggle").toggleClass(
|
||||
"rotate-icon-down",
|
||||
!this.other_users_is_collapsed,
|
||||
);
|
||||
$("#buddy-list-other-users-container .toggle-other-users").toggleClass(
|
||||
$("#buddy-list-other-users-container .buddy-list-section-toggle").toggleClass(
|
||||
"rotate-icon-right",
|
||||
this.other_users_is_collapsed,
|
||||
);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h5 id="{{id}}" data-user-count="{{user_count}}" class="buddy-list-heading no-style hidden-for-spectators">
|
||||
{{header_text}} (<span class="buddy-list-heading-user-count">{{user_count}}</span>)
|
||||
</h5>
|
||||
<i class="buddy-list-section-toggle {{toggle_class}} fa fa-sm fa-caret-right {{#if is_collapsed}}rotate-icon-right{{else}}rotate-icon-down{{/if}}" aria-hidden="true"></i>
|
||||
<i class="buddy-list-section-toggle fa fa-sm fa-caret-right {{#if is_collapsed}}rotate-icon-right{{else}}rotate-icon-down{{/if}}" aria-hidden="true"></i>
|
||||
|
|
Loading…
Reference in New Issue