mirror of https://github.com/apache/nifi.git
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 <bbende@apache.org>
This commit is contained in:
parent
1db5e73102
commit
321a2398ba
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue