Skip to content

Commit

Permalink
#2584 WIP fixing show across teams map icon setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wotuu committed Oct 24, 2024
1 parent 80e995c commit 1aeba4d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions resources/assets/js/custom/models/mapicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,25 @@ class MapIcon extends Icon {

return this._cachedAttributes = super._getAttributes(force).concat([
new Attribute({
// Reads team_id, stores as show_across_team
// Modified by show_across_team
name: 'team_id',
type: 'int',
default: null,
edit: false
}),
new Attribute({
// Reads team_id, stores as show_across_team
name: 'show_across_team',
type: 'bool',
default: self.team_id !== null,
edit: getState().getMapContext().getTeamId() >= 1,
setter: function (value) {
// If team_id is not null, we show this across the entire team
this.show_across_team = value;
self.show_across_team = value;
self._setValue('team_id', value ? getState().getMapContext().getTeamId() : null);
},
getter: function () {
return this.show_across_team ? getState().getMapContext().getTeamId() : null;
return self.show_across_team;
}
}),
new Attribute({
Expand Down

0 comments on commit 1aeba4d

Please sign in to comment.