Skip to content

Commit

Permalink
Fix #249: consistent cleanup of overlay window in HTML tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippWendler committed Nov 4, 2017
1 parent 44fb216 commit 3422858
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions benchexec/tablegenerator/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@
// hide the content pane on mouse click outside the content pane
// or when pressing the "Esc" key with the content pane focused
if (event.type == "click" || escKeyPressed(event)) {
hideContentPane();
$('#contentPaneBackground').hide();
$('#contentPane').hide().empty();
isRowFilterPaneActive = false;
}

// On closing the dialog, turn on the scrollable header, if it's not on
Expand All @@ -391,9 +393,8 @@
}

function hideContentPane() {
$('#contentPaneBackground').hide();
$('#contentPane').hide().empty();
isRowFilterPaneActive = false;
// Execute catchHideContentPane and any other registered cleanup functions
$('#contentPaneBackground').trigger('click');
}

function escKeyPressed(event) {
Expand Down Expand Up @@ -715,6 +716,7 @@


function createColumnToggleView() {
hideContentPane(); // cleanup
// Turn the float-thead on and off.
$("#dataTable").floatThead('destroy');

Expand Down Expand Up @@ -803,7 +805,7 @@
.appendTo(rowHeader)
.addClass('clickable')
.click(function(event) { // iterate through statistics
$('#contentPaneBackground').click(); // cleanup
hideContentPane(); // cleanup
createStatsView(statistics, (currentIndex + 1) % statistics.length);
} )
.attr('title', originalCell.attr('title'));
Expand Down Expand Up @@ -865,13 +867,12 @@
<script type="text/javascript">

function createRowFilterButtons() {
hideContentPane(); // cleanup
if (isRowFilterPaneActive) {
return;
}
isRowFilterPaneActive = true;

$("#contentPane").empty();

var buttonList = $('<form>', {id:'rowFilterButtons', onsubmit:'return false'})
.appendTo($("#contentPane"));
var columnIndex = 0;
Expand Down Expand Up @@ -1441,7 +1442,7 @@
}

function showScatterPlot() {
$('#contentPaneBackground').trigger('click'); // cleanup
hideContentPane(); // cleanup
var contentPane = $('#contentPane').append('<div id="chart"></div>');
addButtons(contentPane, showScatterPlot, false);
showContentPane();
Expand Down Expand Up @@ -1588,7 +1589,7 @@
}

function showQuantilePlot() {
$('#contentPaneBackground').trigger('click'); // cleanup
hideContentPane(); // cleanup
$('#contentPane').append('<div id="chart"></div>');
addButtons($('#contentPane'), showQuantilePlot, true);
showContentPane();
Expand Down

0 comments on commit 3422858

Please sign in to comment.