You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2014/12/30 14:09:15 UTC
incubator-nifi git commit: NIFI-24: - Updating the state of the
enable/disable button in the toolbar when appropriate.
Repository: incubator-nifi
Updated Branches:
refs/heads/develop 6f1c12f5e -> d27d2e303
NIFI-24:
- Updating the state of the enable/disable button in the toolbar when appropriate.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/d27d2e30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/d27d2e30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/d27d2e30
Branch: refs/heads/develop
Commit: d27d2e303e8badf24e07259cbc79bfadd0023bbd
Parents: 6f1c12f
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Dec 30 07:43:20 2014 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Dec 30 07:43:20 2014 -0500
----------------------------------------------------------------------
.../main/webapp/js/nf/canvas/nf-canvas-toolbar.js | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/d27d2e30/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
index 23cb20f..38707d8 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-toolbar.js
@@ -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();
+ }
}
}
};