diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php
index 1cd0682e8b..80e26f2919 100644
--- a/pandora_console/operation/events/sound_events.php
+++ b/pandora_console/operation/events/sound_events.php
@@ -77,8 +77,12 @@ $table->data[1][1] = html_print_checkbox('alert_fired', 'alert_fired', true, tru
html_print_checkbox('critical', 'critical', true, true, false, 'changeType();') . __('Monitor critical') . '
' .
html_print_checkbox('warning', 'warning', true, true, false, 'changeType();') . __('Monitor warning') . '
' .
$table->data[2][0] = '';
-$table->data[2][1] = '' . html_print_image("images/play.button.png", true, array("id" => "button")) . '';
-$table->data[2][1] .= '' . html_print_image("images/ok.button.png", true, array("style" => "margin-left: 10px;")) . '';
+$table->data[2][1] = '' .
+ html_print_image("images/play.button.png", true, array("id" => "button")) .
+ '';
+$table->data[2][1] .= '' .
+ html_print_image("images/ok.button.png", true,
+ array("style" => "margin-left: 10px;")) . '';
html_print_table($table);
?>
@@ -96,6 +100,8 @@ var id_row = 0;
var redBackground = false;
+var button_play_status = "play";
+
function changeGroup() {
group = $("#group").val();
}
@@ -107,14 +113,22 @@ function changeType() {
}
function toggleButton() {
- if ($("#button").attr('src') == '../../images/pause.button.png') {
+
+ if (button_play_status == 'pause') {
+ //~ if ($("#button").attr('src') == '../../images/pause.button.png') {
+
$("#button").attr('src', '../../images/play.button.png');
stopSound();
+
+ button_play_status = 'play';
}
else {
+
$("#button").attr('src', '../../images/pause.button.png');
forgetPreviousEvents();
startSound();
+
+ button_play_status = 'pause';
}
}
@@ -135,7 +149,6 @@ function stopSound() {
}
function startSound() {
- $('embed').remove();
//running = true;
}
@@ -177,7 +190,6 @@ function check_event() {
if (firedId != 0) {
id_row = firedId;
fired = true;
- $('embed').remove();
$('body').append("