Disable webcam stream when control tab is not in focus.
Fixes #316
(cherry picked from commit 1b4a7c7)
This commit is contained in:
parent
3ddfc93c1b
commit
722b03dca8
1 changed files with 11 additions and 0 deletions
|
|
@ -51,6 +51,17 @@ $(function() {
|
|||
terminalViewModel.updateOutput();
|
||||
});
|
||||
|
||||
$('#tabs a[data-toggle="tab"]').on('show', function (e) {
|
||||
var current = e.target;
|
||||
var previous = e.relatedTarget;
|
||||
|
||||
if (current.hash == "#control") {
|
||||
$("#webcam_image").attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime());
|
||||
} else if (previous.hash == "#control") {
|
||||
$("#webcam_image").attr("src", "#");
|
||||
}
|
||||
});
|
||||
|
||||
//~~ Gcode upload
|
||||
|
||||
function gcode_upload_done(e, data) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue