mirror of https://github.com/apache/nifi.git
NIFI-24:
- Updating the state of the enable/disable button in the toolbar when appropriate.
This commit is contained in:
parent
6f1c12f5ef
commit
d27d2e303e
|
@ -148,11 +148,26 @@ nf.CanvasToolbar = (function () {
|
|||
});
|
||||
|
||||
// if there are any colorable components enable the button
|
||||
if (nf.Common.isDefinedAndNotNull(colorableComponents) && colorableComponents.size() === 1 && colorableComponents.size() === selection.size()) {
|
||||
if (colorableComponents.size() === 1 && colorableComponents.size() === selection.size()) {
|
||||
actions['fill'].enable();
|
||||
} else {
|
||||
actions['fill'].disable();
|
||||
}
|
||||
|
||||
// determine if there are any selected components that support enable/disable
|
||||
var supportsEnable = selection.filter(function(d) {
|
||||
var selected = d3.select(this);
|
||||
return nf.CanvasUtils.isProcessor(selected) || nf.CanvasUtils.isInputPort(selected) || nf.CanvasUtils.isOutputPort(selected);
|
||||
});
|
||||
|
||||
// ensure the entire selection supports enable/disable
|
||||
if (!supportsEnable.empty() && supportsEnable.size() === selection.size()) {
|
||||
actions['enable'].enable();
|
||||
actions['disable'].enable();
|
||||
} else {
|
||||
actions['enable'].disable();
|
||||
actions['disable'].disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue