Skip to content

Commit

Permalink
Implement CTRL-click to open event in a new tab/window
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed May 30, 2022
1 parent f16d57d commit 125f7f7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions web/skins/classic/views/js/montagereview.js
Expand Up @@ -899,23 +899,26 @@ function maxfit2(divW, divH) {

// >>>>>>>>>>>>>>>> Handles individual monitor clicks and navigation to the standard event/watch display

function showOneMonitor(monId) {
function showOneMonitor(monId, event) {
// link out to the normal view of one event's data
// We know the monitor, need to determine the event based on current time
var url;
let url = '';
if ( liveMode != 0 ) {
url = '?view=watch&mid=' + monId.toString();
window.location.assign(url);
url = '?view=watch&mid=' + monId.toString();
} else {
var Frame = getFrame(monId, currentTimeSecs);
const Frame = getFrame(monId, currentTimeSecs);
if ( Frame ) {
url = '?view=event&eid=' + Frame.EventId + '&fid=' + Frame.FrameId;
window.location.assign(url);
} else {
url = '?view=watch&mid=' + monId.toString();
window.location.assign(url);
}
} // end if live/events

if (event.ctrlKey) {
window.open(url, '_blank');
} else {
window.location.assign(url);
}
}

function zoom(monId, scale) {
Expand All @@ -939,7 +942,7 @@ function clickMonitor(event) {
} else if ( pos_x > element.width * 3/4 && pos_y < element.height/4 ) {
zoom(monId, 1/1.15);
} else {
showOneMonitor(monId);
showOneMonitor(monId, event);
}
return;
}
Expand Down

0 comments on commit 125f7f7

Please sign in to comment.