mirror of
https://github.com/nasa/openmct.git
synced 2025-05-30 06:04:20 +00:00
only update selection if selectable has changed (#3573)
This commit is contained in:
parent
1c2b0678be
commit
2e1d57aa8c
@ -70,11 +70,8 @@ define(
|
|||||||
if (multiSelect) {
|
if (multiSelect) {
|
||||||
this.handleMultiSelect(selectable);
|
this.handleMultiSelect(selectable);
|
||||||
} else {
|
} else {
|
||||||
this.setSelectionStyles(selectable);
|
this.handleSingleSelect(selectable);
|
||||||
this.selected = [selectable];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit('change', this.selected);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,6 +84,20 @@ define(
|
|||||||
this.addSelectionAttributes(selectable);
|
this.addSelectionAttributes(selectable);
|
||||||
this.selected.push(selectable);
|
this.selected.push(selectable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.emit('change', this.selected);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
Selection.prototype.handleSingleSelect = function (selectable) {
|
||||||
|
if (!_.isEqual([selectable], this.selected)) {
|
||||||
|
this.setSelectionStyles(selectable);
|
||||||
|
this.selected = [selectable];
|
||||||
|
|
||||||
|
this.emit('change', this.selected);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user