mirror of
https://github.com/nasa/openmct.git
synced 2025-03-21 19:45:23 +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) {
|
||||
this.handleMultiSelect(selectable);
|
||||
} else {
|
||||
this.setSelectionStyles(selectable);
|
||||
this.selected = [selectable];
|
||||
this.handleSingleSelect(selectable);
|
||||
}
|
||||
|
||||
this.emit('change', this.selected);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -87,6 +84,20 @@ define(
|
||||
this.addSelectionAttributes(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