diff --git a/tabs/pid_tuning.js b/tabs/pid_tuning.js index 5efd4c92..038e7ce0 100755 --- a/tabs/pid_tuning.js +++ b/tabs/pid_tuning.js @@ -337,20 +337,6 @@ TABS.pid_tuning.initialize = function (callback) { } } - var showAllButton = $('#showAllPids'); - - function updatePidDisplay() { - if (!TABS.pid_tuning.showAllPids) { - hideUnusedPids(); - - showAllButton.text(chrome.i18n.getMessage("pidTuningShowAllPids")); - } else { - showAllPids(); - - showAllButton.text(chrome.i18n.getMessage("pidTuningHideUnusedPids")); - } - } - function drawAxes(curveContext, width, height, scaleHeight) { curveContext.strokeStyle = '#000000'; curveContext.lineWidth = 4; @@ -440,6 +426,20 @@ TABS.pid_tuning.initialize = function (callback) { self.currentRates.pitch_rate = RC_tuning.roll_pitch_rate; } + var showAllButton = $('#showAllPids'); + + function updatePidDisplay() { + if (!TABS.pid_tuning.showAllPids) { + hideUnusedPids(); + + showAllButton.text(chrome.i18n.getMessage("pidTuningShowAllPids")); + } else { + showAllPids(); + + showAllButton.text(chrome.i18n.getMessage("pidTuningHideUnusedPids")); + } + } + updatePidDisplay(); showAllButton.on('click', function(){