1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 14:25:14 +03:00

Moved dialog to main page

And fixed some strings in messages.json
This commit is contained in:
fgiudice98 2020-07-05 20:20:06 +02:00
parent 69603ee46b
commit 69cd83abdd
7 changed files with 28 additions and 43 deletions

View file

@ -1472,11 +1472,11 @@
"message": "Dynamic Notch values change" "message": "Dynamic Notch values change"
}, },
"dialogDynFiltersChangeNote": { "dialogDynFiltersChangeNote": {
"message": "<span class=\"message-negative\"><b>WARNING: Some dynamic notch values have been changed to default values</b></span> because the RPM filtering has been activated/deactivated.<br> Please, check before flying" "message": "<span class=\"message-negative\"><b>WARNING: Some dynamic notch values have been changed to default values</b></span> because the RPM filtering has been activated/deactivated.<br> Please, check before flying."
}, },
"dialogDynFiltersConfirm": { "dialogDynFiltersConfirm": {
"message": "OK", "message": "OK"
},
"portsIdentifier": { "portsIdentifier": {
"message": "Identifier" "message": "Identifier"
}, },

View file

@ -760,3 +760,15 @@ function showErrorDialog(message) {
dialog.showModal(); dialog.showModal();
} }
function showDialogDynFiltersChange() {
const dialogDynFiltersChange = $('.dialogDynFiltersChange')[0];
if (!dialogDynFiltersChange.hasAttribute('open')) {
dialogDynFiltersChange.showModal();
$('.dialogDynFiltersChange-confirmbtn').click(function() {
dialogDynFiltersChange.close();
});
}
}

View file

@ -541,15 +541,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
if (FILTER_CONFIG.dyn_notch_width_percent !== self.previousFilterDynWidth) { if (FILTER_CONFIG.dyn_notch_width_percent !== self.previousFilterDynWidth) {
const dialogDynFiltersChange = $('.dialogDynFiltersChange')[0]; showDialogDynFiltersChange();
if (!dialogDynFiltersChange.hasAttribute('open')) {
dialogDynFiltersChange.showModal();
$('.dialogDynFiltersChange-confirmbtn').click(function() {
dialogDynFiltersChange.close();
});
}
} }
}); });

View file

@ -407,15 +407,7 @@ TABS.pid_tuning.initialize = function (callback) {
dynamicNotchQ_e.val(FILTER_DEFAULT.dyn_notch_q); dynamicNotchQ_e.val(FILTER_DEFAULT.dyn_notch_q);
} }
const dialogDynFiltersChange = $('.dialogDynFiltersChange')[0]; showDialogDynFiltersChange();
if (!dialogDynFiltersChange.hasAttribute('open')) {
dialogDynFiltersChange.showModal();
$('.dialogDynFiltersChange-confirmbtn').click(function() {
dialogDynFiltersChange.close();
});
}
} else { // same value, return saved values } else { // same value, return saved values
dynamicNotchWidthPercent_e.val(FILTER_CONFIG.dyn_notch_width_percent); dynamicNotchWidthPercent_e.val(FILTER_CONFIG.dyn_notch_width_percent);

View file

@ -413,6 +413,17 @@
</div> </div>
</dialog> </dialog>
<dialog class="dialogDynFiltersChange">
<h3 i18n="dialogDynFiltersChangeTitle"></h3>
<div class="content">
<div i18n="dialogDynFiltersChangeNote" style="margin-top: 10px"></div>
</div>
<div class="buttons">
<a href="#" class="dialogDynFiltersChange-confirmbtn regular-button" i18n="dialogDynFiltersConfirm"></a>
</div>
</dialog>
<ul class="hidden"> <!-- Sonar says so --> <ul class="hidden"> <!-- Sonar says so -->
<li id="dialogReportProblems-listItemTemplate" class="dialogReportProblems-listItem"></li> <li id="dialogReportProblems-listItemTemplate" class="dialogReportProblems-listItem"></li>
</ul> </ul>

View file

@ -774,15 +774,4 @@
</div> </div>
</div> </div>
</div> </div>
<dialog class="dialogDynFiltersChange">
<h3 i18n="dialogDynFiltersChangeTitle"></h3>
<div class="content">
<div i18n="dialogDynFiltersChangeNote" style="margin-top: 10px"></div>
</div>
<div class="buttons">
<a href="#" class="dialogDynFiltersChange-confirmbtn regular-button" i18n="dialogDynFiltersConfirm"></a>
</div>
</dialog>
</div> </div>

View file

@ -1602,15 +1602,4 @@
<a href="#" class="dialogRatesType-cancelbtn regular-button" i18n="cancel"></a> <a href="#" class="dialogRatesType-cancelbtn regular-button" i18n="cancel"></a>
</div> </div>
</dialog> </dialog>
<dialog class="dialogDynFiltersChange">
<h3 i18n="dialogDynFiltersChangeTitle"></h3>
<div class="content">
<div i18n="dialogDynFiltersChangeNote" style="margin-top: 10px"></div>
</div>
<div class="buttons">
<a href="#" class="dialogDynFiltersChange-confirmbtn regular-button" i18n="dialogDynFiltersConfirm"></a>
</div>
</dialog>
</div> </div>