Skip to content

Commit

Permalink
QA: Restore SpikeKill Menu
Browse files Browse the repository at this point in the history
TheWitness committed Dec 29, 2024
1 parent cb6cc35 commit 51629b6
Showing 4 changed files with 25 additions and 9 deletions.
4 changes: 4 additions & 0 deletions include/themes/dark/main.js
Original file line number Diff line number Diff line change
@@ -109,6 +109,10 @@ function themeReady() {
element = $(this);
clearTimeout(graphMenuTimer);
graphMenuTimer = setTimeout(function() { hideGraphMenu(element); }, 400);

if (typeof spikeKillClose == 'function') {
spikeKillClose();
}
}
);

4 changes: 4 additions & 0 deletions include/themes/midwinter/main.js
Original file line number Diff line number Diff line change
@@ -798,6 +798,10 @@ function setupDefaultElements() {
element = $(this);
clearTimeout(graphMenuTimer);
graphMenuTimer = setTimeout(function() { hideGraphMenu(element); }, 400);

if (typeof spikeKillClose == 'function') {
spikeKillClose();
}
}
);

4 changes: 4 additions & 0 deletions include/themes/sunrise/main.js
Original file line number Diff line number Diff line change
@@ -173,6 +173,10 @@ function themeReady() {
element = $(this);
clearTimeout(graphMenuTimer);
graphMenuTimer = setTimeout(function() { hideGraphMenu(element); }, 400);

if (typeof spikeKillClose == 'function') {
spikeKillClose();
}
}
);

22 changes: 13 additions & 9 deletions lib/html.php
Original file line number Diff line number Diff line change
@@ -2921,20 +2921,18 @@ function html_spikekill_menu($local_graph_id) {
function html_spikekill_js() {
?>
<script type='text/javascript'>
spikeKillOpen = false;
var spikeKillOpen = false;

$(function() {
$(document).click(function() {
if (spikeKillOpen) {
$(this).find('.spikekillMenu').menu('destroy').parent().remove();
spikeKillOpen = false;
}
spikeKillClose();
});

$('span.spikekill').children().contextmenu(function() {
$('div.spikekill').children().contextmenu(function() {
return false;
});

$('span.spikekill').unbind().click(function() {
$('div.spikekill').unbind().click(function() {
if (spikeKillOpen == false) {
local_graph_id = $(this).attr('data-graph');

@@ -2967,12 +2965,18 @@ function html_spikekill_js() {
});

} else {
spikeKillOpen = false;
$(this).find('.spikekillMenu').menu('destroy').parent().remove();
spikeKillClose();
}
});
});

function spikeKillClose() {
if (spikeKillOpen) {
$(document).find('.spikekillMenu').menu('destroy').parent().remove();
spikeKillOpen = false;
}
}

function spikeKillActions() {
$('.rstddev').unbind().click(function() {
removeSpikesStdDev($(this).attr('data-graph'));

0 comments on commit 51629b6

Please sign in to comment.