mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 00:45:41 +00:00
[Edit] Default to inclusive mode
Default to inclusive mode in Edit mode toolbar; simplifies adding additional toolbar elements for Fixed Position view, WTD-881.
This commit is contained in:
parent
46c8a456b7
commit
f894233182
@ -17,10 +17,10 @@ view's scope.) These additional properties are:
|
||||
an argument to set.)
|
||||
* `method`: Name of a method to invoke upon a selected object when
|
||||
a control is activated, e.g. on a button click.
|
||||
* `inclusive`: Optional; true if this control should be considered
|
||||
applicable whenever at least one element in the selection has
|
||||
the associated property. Otherwise, all members of the current
|
||||
selection must have this property for the control to be shown.
|
||||
* `exclusive`: Optional; true if this control should be considered
|
||||
applicable only when all elements in the selection has
|
||||
the associated property. Otherwise, only at least one member of the
|
||||
current selection must have this property for the control to be shown.
|
||||
|
||||
Controls in the toolbar are shown based on applicability to the
|
||||
current selection. Applicability for a given member of the selection
|
||||
|
@ -108,7 +108,7 @@ define(
|
||||
function isApplicable(item) {
|
||||
var property = (item || {}).property,
|
||||
method = (item || {}).method,
|
||||
exclusive = !(item || {}).inclusive;
|
||||
exclusive = (item || {}).exclusive;
|
||||
|
||||
// Check if a selected item defines this property
|
||||
function hasProperty(selected) {
|
||||
|
@ -57,6 +57,7 @@ define(
|
||||
commit("Changes from toolbar.");
|
||||
}
|
||||
|
||||
// Initialize toolbar (expose object to parent scope)
|
||||
function initialize() {
|
||||
// If we have been asked to expose toolbar state...
|
||||
if (attrs.toolbar) {
|
||||
@ -67,7 +68,7 @@ define(
|
||||
|
||||
// Represent a domain object using this definition
|
||||
function represent(representation) {
|
||||
//
|
||||
// Expose the toolbar object to the parent scope
|
||||
initialize();
|
||||
// Clear any existing selection
|
||||
scope.selection = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user