[missions] bugfix: mwpid now includes waypoint index
otherwise, you wouldn't be able to mark waypoints for hidden missions or duplicate portals (i.e. when a portal appears more than once in a mission)
This commit is contained in:
parent
933843bd68
commit
d682ba17c7
@ -487,7 +487,7 @@ window.plugin.missions = {
|
||||
else
|
||||
title.textContent = 'Unknown';
|
||||
|
||||
var mwpid = mission.guid + '-' + waypoint.guid;
|
||||
var mwpid = mission.guid + '-' + index + '-' + waypoint.guid;
|
||||
var checked = this.checkedWaypoints[mwpid];
|
||||
|
||||
var label = container.appendChild(document.createElement('label'));
|
||||
@ -495,7 +495,7 @@ window.plugin.missions = {
|
||||
var checkbox = label.appendChild(document.createElement('input'));
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.addEventListener('change', function() {
|
||||
plugin.missions.toggleWaypoint(mission.guid, waypoint.guid);
|
||||
plugin.missions.toggleWaypoint(mission.guid, mwpid);
|
||||
}, false);
|
||||
checkbox.dataset['mission_mwpid'] = mwpid;
|
||||
|
||||
@ -524,8 +524,7 @@ window.plugin.missions = {
|
||||
return container;
|
||||
},
|
||||
|
||||
toggleWaypoint: function(mid, wpid, dontsave) {
|
||||
var mwpid = mid + '-' + wpid;
|
||||
toggleWaypoint: function(mid, mwpid, dontsave) {
|
||||
if(this.checkedWaypoints[mwpid])
|
||||
delete this.checkedWaypoints[mwpid];
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user