From: Calin Crisan Date: Sun, 13 Oct 2013 09:49:05 +0000 (+0300) Subject: set preview stops refreshing X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=a31ec4512fde0f7f618fbeecb1aa914ee2b5769c;p=motioneye-debian set preview stops refreshing --- diff --git a/doc/todo.txt b/doc/todo.txt index 50b7e7a..bd4dcd7 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1,5 +1,3 @@ --> default sat/contrast/hue... for existing conf file is somehow 0 --> request closed while setting the preview params -> applying progress sometimes does not appear on frame -> style scroll bars diff --git a/static/js/main.js b/static/js/main.js index 6fd6d42..c40de50 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,5 +1,6 @@ var pushConfigs = {}; +var refreshDisabled = 0; /* utils */ @@ -661,6 +662,8 @@ function showProgress() { applyButton.addClass('progress'); $('div.camera-progress').css('opacity', '0.5'); + + refreshDisabled++; } function hideApply() { @@ -685,6 +688,8 @@ function endProgress() { } $('div.camera-progress').css('opacity', '0'); + + refreshDisabled--; } function isProgress() { @@ -859,7 +864,11 @@ function pushPreview() { 'hue': hue }; + refreshDisabled++; + ajax('POST', '/config/' + cameraId + '/set_preview/', data, function (data) { + refreshDisabled--; + if (data == null || data.error) { showErrorMessage(data && data.error); return; @@ -1259,8 +1268,8 @@ function doCloseCamera(cameraId) { } function refreshCameraFrames() { - if (isProgress()) { - /* no camera refreshing while in progress */ + if (refreshDisabled) { + /* camera refreshing disabled, retry later */ setTimeout(refreshCameraFrames, 1000);