diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c682e8d2..82625ae5 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -754,6 +754,12 @@ "pidTuningName": { "message": "Name" }, + "pidTuningShowAllPids": { + "message": "Show all PIDs" + }, + "pidTuningHideUnusedPids": { + "message": "Hide unused PIDs" + }, "pidTuningProportional": { "message": "Proportional" }, @@ -781,16 +787,16 @@ "pidTuningTPABreakPoint": { "message": "TPA Breakpoint" }, - "pidTuningFilter": { + "pidTuningFilter": { "message": "Filter" }, - "pidTuningFilterFrequency": { + "pidTuningFilterFrequency": { "message": "Frequency" }, - "rcCurve": { + "pidTuningRcCurve": { "message": "RC Curve" }, - "rcYawCurve": { + "pidTuningRcYawCurve": { "message": "RC Yaw Curve" }, "throttle": { diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index 8eec1445..fe43e1f2 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -226,7 +226,7 @@ - + @@ -247,7 +247,7 @@
- + diff --git a/tabs/pid_tuning.js b/tabs/pid_tuning.js index 7f9aaa32..20e67481 100755 --- a/tabs/pid_tuning.js +++ b/tabs/pid_tuning.js @@ -316,29 +316,27 @@ TABS.pid_tuning.initialize = function (callback) { localize(); var showAllButton = $('#showAllPids'); - var showAllMsg = "Show all PIDs"; - var hideUnusedMsg = "Hide unused PIDs"; + var showAllMsg = chrome.i18n.getMessage("pidTuningShowAllPids"); + var hideUnusedMsg = chrome.i18n.getMessage("pidTuningHideUnusedPids"); - if (!TABS.pid_tuning.showAllPids) { - hideUnusedPids(); - showAllButton.text(showAllMsg); - } else { - showAllPids(); - showAllButton.text(hideUnusedMsg); + function updatePidDisplay() { + if (!TABS.pid_tuning.showAllPids) { + hideUnusedPids(); + + showAllButton.text(showAllMsg); + } else { + showAllPids(); + + showAllButton.text(hideUnusedMsg); + } } - $('#showAllPids').on('click', function(){ - if($(this).text() == showAllMsg) { - showAllPids(); - $(this).text(hideUnusedMsg); + updatePidDisplay(); - TABS.pid_tuning.showAllPids = true; - } else { - hideUnusedPids(); - $(this).text(showAllMsg); + showAllButton.on('click', function(){ + TABS.pid_tuning.showAllPids = !TABS.pid_tuning.showAllPids; - TABS.pid_tuning.showAllPids = false; - } + updatePidDisplay(); }); $('#resetPIDs').on('click', function(){