NIFI-231:

- Cleaning up all tooltips that are based on dynamic content.
This commit is contained in:
Matt Gilman 2015-01-07 10:22:27 -05:00
parent 645837491c
commit 2de45b62a7
5 changed files with 62 additions and 8 deletions

View File

@ -553,7 +553,13 @@ nf.ProcessorPropertyTable = (function () {
* Clears the property table.
*/
clear: function () {
var propertyGrid = $('#processor-properties').data('gridInstance');
var propertyGridElement = $('#processor-properties');
// clean up any tooltips that may have been generated
nf.Common.cleanUpTooltips(propertyGridElement, 'img.icon-info');
// clear the data in the grid
var propertyGrid = propertyGridElement.data('gridInstance');
var propertyData = propertyGrid.getData();
propertyData.setItems([]);
}

View File

@ -161,6 +161,11 @@ nf.RemoteProcessGroupPorts = (function () {
$('#remote-process-group-ports-id').text('');
$('#remote-process-group-ports-name').text('');
$('#remote-process-group-ports-url').text('');
// clear any tooltips
var dialog = $('#remote-process-group-ports');
nf.Common.cleanUpTooltips(dialog, 'div.remote-port-removed');
nf.Common.cleanUpTooltips(dialog, 'img.concurrent-tasks-info');
// clear the input and output ports
$('#remote-process-group-input-ports-container').empty();

View File

@ -295,6 +295,22 @@ nf.Common = {
return $('#' + target).removeClass('unset blank').text('');
},
/**
* Cleans up any tooltips that have been created for the specified container.
*
* @param {jQuery} container
* @param {string} tooltipTarget
*/
cleanUpTooltips: function(container, tooltipTarget) {
container.find(tooltipTarget).each(function () {
var tip = $(this);
if (tip.data('qtip')) {
var api = tip.qtip('api');
api.destroy(true);
}
});
},
/**
* Formats the tooltip for the specified property.
*

View File

@ -230,8 +230,14 @@ nf.ProcessorDetails = (function () {
// empty the relationship list
$('#read-only-auto-terminate-relationship-names').css('border-width', '0').empty();
// clear the grid
var propertyGrid = $('#read-only-processor-properties').data('gridInstance');
// get the property grid element
var propertyGridElement = $('#read-only-processor-properties');
// clean up any tooltips that may have been generated
nf.Common.cleanUpTooltips(propertyGridElement, 'img.icon-info');
// clear the data in the grid
var propertyGrid = propertyGridElement.data('gridInstance');
var propertyData = propertyGrid.getData();
propertyData.setItems([]);

View File

@ -1959,7 +1959,7 @@ nf.SummaryTable = (function () {
}
}).fail(nf.Common.handleAjaxError);
};
return {
/**
* URL for loading system diagnostics.
@ -2040,19 +2040,40 @@ nf.SummaryTable = (function () {
var processGroupStatus = response.processGroupStatus;
if (nf.Common.isDefinedAndNotNull(processGroupStatus)) {
var processorsGrid = $('#processor-summary-table').data('gridInstance');
// remove any tooltips from the processor table
var processorsGridElement = $('#processor-summary-table');
nf.Common.cleanUpTooltips(processorsGridElement, 'img.has-bulletins');
// get the processor grid/data
var processorsGrid = processorsGridElement.data('gridInstance');
var processorsData = processorsGrid.getData();
// get the connections grid/data (do not render bulletins)
var connectionsGrid = $('#connection-summary-table').data('gridInstance');
var connectionsData = connectionsGrid.getData();
var inputPortsGrid = $('#input-port-summary-table').data('gridInstance');
// remove any tooltips from the input port table
var inputPortsGridElement = $('#input-port-summary-table');
nf.Common.cleanUpTooltips(inputPortsGridElement, 'img.has-bulletins');
// get the input ports grid/data
var inputPortsGrid = inputPortsGridElement.data('gridInstance');
var inputPortsData = inputPortsGrid.getData();
var outputPortsGrid = $('#output-port-summary-table').data('gridInstance');
// remove any tooltips from the output port table
var outputPortsGridElement = $('#output-port-summary-table');
nf.Common.cleanUpTooltips(outputPortsGridElement, 'img.has-bulletins');
// get the output ports grid/data
var outputPortsGrid = outputPortsGridElement.data('gridInstance');
var outputPortsData = outputPortsGrid.getData();
var remoteProcessGroupsGrid = $('#remote-process-group-summary-table').data('gridInstance');
// remove any tooltips from the remote process group table
var remoteProcessGroupsGridElement = $('#remote-process-group-summary-table');
nf.Common.cleanUpTooltips(remoteProcessGroupsGridElement, 'img.has-bulletins');
// get the remote process groups grid
var remoteProcessGroupsGrid = remoteProcessGroupsGridElement.data('gridInstance');
var remoteProcessGroupsData = remoteProcessGroupsGrid.getData();
var processorItems = [];