process clicks per cell in frames

This commit is contained in:
Andrew Bauer 2020-08-20 09:13:11 -05:00
parent 7175fa3d86
commit 247ace7fa2
2 changed files with 11 additions and 12 deletions

View File

@ -169,16 +169,8 @@ if ( count($frames) ) {
<td><?php echo $frame['Type'] ?></td>
<td><?php echo strftime(STRF_FMT_TIME, $frame['UnixTimeStamp']) ?></td>
<td><?php echo number_format( $frame['Delta'], 2 ) ?></td>
<?php
if ( ZM_RECORD_EVENT_STATS && ($frame['Type'] == 'Alarm') ) {
?>
<td><?php echo makePopupLink('?view=stats&amp;eid='.$Event->Id().'&amp;fid='.$frame['FrameId'], 'zmStats', 'stats', $frame['Score']) ?></td>
<?php
} else {
?>
<td><?php echo $frame['Score'] ?></td>
<?php
}
if ( ZM_WEB_LIST_THUMBS ) {
$base_img_src = '?view=image&amp;fid=' .$Frame->Id();
$thmb_width = ZM_WEB_LIST_THUMB_WIDTH ? 'width='.ZM_WEB_LIST_THUMB_WIDTH : '';

View File

@ -17,9 +17,16 @@ function initThumbAnimation() {
});
}
function gotoFrame(e, row, element) {
//alert('?view=frame&eid='+row.EventId+'&fid='+row.FramesId)
window.location.assign('?view=frame&eid='+row.EventId+'&fid='+row.FramesId);
function processClicks(event, field, value, row, $element) {
if ( field == 'FramesScore' ) {
if ( value > 0 ) {
window.location.assign('?view=stats&eid='+row.EventId+'&fid='+row.FramesId);
} else {
alert("No statistics available");
}
} else {
window.location.assign('?view=frame&eid='+row.EventId+'&fid='+row.FramesId);
}
}
function initPage() {
@ -57,7 +64,7 @@ function initPage() {
table.on('all.bs.table', initThumbAnimation);
// Load the associated frame image when the user clicks on a row
table.on('click-row.bs.table', gotoFrame);
table.on('click-cell.bs.table', processClicks);
// Manage the BACK button
document.getElementById("backBtn").addEventListener("click", function onBackClick(evt) {