From 2b81162fbf0d52724a9fc72e263b6d53d07fcca3 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 5 Dec 2018 14:16:30 +0100 Subject: [PATCH] fix preset lookup --- static/js/cccc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/cccc.js b/static/js/cccc.js index de99cca..cb943d5 100644 --- a/static/js/cccc.js +++ b/static/js/cccc.js @@ -376,7 +376,9 @@ function updateShiftStatus() { if (response.result) { if (response.result.status) { current_position = response.result.status; - var preset = presets[parseInt($('select[name=preset-editor]').val(), 10)]; + var preset = presets.filter(function(p) { + return p.id == parseInt($('select[name=preset-editor]').val(), 10) + })[0]; preset_offset['azimuth'] = preset['position']['azimuth'] - current_position['azimuth']; preset_offset['elevation'] = preset['position']['elevation'] - current_position['elevation']; preset_offset['absoluteZoom'] = preset['position']['absoluteZoom'] - current_position['absoluteZoom'];