Skip to content

Commit

Permalink
Merged PR 262: Removes selection from team when filtered out
Browse files Browse the repository at this point in the history
Removes selection from team when filtered out

Related work items: #13628
  • Loading branch information
chrismason authored and Kees Verhaar committed Oct 30, 2017
2 parents 67afb9e + 551e1b6 commit c24fa9a
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@ export class TeamSelectorControl extends UIControls.BaseControl {
if (isVisible) {
this._element.find("#" + this._getTeamId(team)).show();
} else {
if (this._selectedTeam && this._selectedTeam.team.id === team.id) {
this._element.find("input[name='" + this._getInputName() + "']").each((idx, element) => {
if ((<any>(element)).value === team.id && element.checked) {
let labels: NodeListOf<HTMLElement> = (<any>element).labels;
let label = labels[0];
label.classList.remove("is-checked");
this._onChanged(null);
}
});
}
this._element.find("#" + this._getTeamId(team)).hide();
}
}
Expand All @@ -334,7 +344,10 @@ export class TeamSelectorControl extends UIControls.BaseControl {
*/
private _onChanged(event: JQueryEventObject) {
let numberSelectedTeams = this.getNumberSelectedTeams();
let teamId = getCheckedValue(event);
let teamId = null;
if (event) {
teamId = getCheckedValue(event);
}

this._setNumberSelectedTeamsCounter(numberSelectedTeams);

Expand Down

0 comments on commit c24fa9a

Please sign in to comment.