Repository: nifi Updated Branches: refs/heads/master 1db5e7310 -> 321a2398b
NIFI-2467: - Resetting cached search term when closing the dialog to ensure the same search time works upon re-opening. NIFI-2467: - Fixing issue preventing the selection of an autocomplete result. This closes #784. Signed-off-by: Bryan Bende <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/321a2398 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/321a2398 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/321a2398 Branch: refs/heads/master Commit: 321a2398ba7a729b45c3faa66926f2c890f7c97d Parents: 1db5e73 Author: Matt Gilman <[email protected]> Authored: Thu Aug 4 09:04:33 2016 -0400 Committer: Bryan Bende <[email protected]> Committed: Thu Aug 4 11:22:01 2016 -0400 ---------------------------------------------------------------------- .../src/main/webapp/js/nf/canvas/nf-policy-management.js | 6 +++++- .../src/main/webapp/js/nf/summary/nf-cluster-search.js | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/321a2398/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js index 6f0756c..adbc42d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-policy-management.js @@ -31,6 +31,7 @@ nf.PolicyManagement = (function () { var initAddTenantToPolicyDialog = function () { $('#new-policy-user-button').on('click', function () { $('#search-users-dialog').modal('show'); + $('#search-users-field').focus(); }); $('#delete-policy-button').on('click', function () { @@ -128,7 +129,7 @@ nf.PolicyManagement = (function () { handler: { close: function () { // reset the search fields - $('#search-users-field').val(''); + $('#search-users-field').userSearchAutocomplete('reset').val(''); $('#selected-user-id').text(''); } } @@ -136,6 +137,9 @@ nf.PolicyManagement = (function () { // configure the user auto complete $.widget('nf.userSearchAutocomplete', $.ui.autocomplete, { + reset: function () { + this.term = null; + }, _normalize: function (searchResults) { var items = []; items.push(searchResults); http://git-wip-us.apache.org/repos/asf/nifi/blob/321a2398/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js index 799c2cc..b5c9e68 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-cluster-search.js @@ -103,13 +103,16 @@ nf.ClusterSearch = (function () { handler: { close: function () { // reset the search field - $('#cluster-search-field').val(config.search).addClass('search-nodes'); + $('#cluster-search-field').val(config.search).addClass('search-nodes').clusterSearchAutocomplete('reset'); } } }); // configure the cluster auto complete $.widget('nf.clusterSearchAutocomplete', $.ui.autocomplete, { + reset: function () { + this.term = null; + }, _normalize: function (searchResults) { var items = []; items.push(searchResults); @@ -134,7 +137,7 @@ nf.ClusterSearch = (function () { }, _resizeMenu: function () { var ul = this.menu.element; - ul.width(299); + ul.width($('#cluster-search-field').width() + 6); } }); @@ -171,6 +174,7 @@ nf.ClusterSearch = (function () { $('#view-single-node-link').click(function () { // hold the search nodes dialog $('#view-single-node-dialog').modal('show'); + $('#cluster-search-field').focus(); }); // handle the view cluster click event
