1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

[TABS] Generate the documentation link dynamically via JS

This way we don't need to repeat the same 3 lines of HTML in every
tab. Also fixes the missing link in the mission planner tab when
the FC wasn't connected.
This commit is contained in:
Alberto García Hierro 2020-04-07 15:52:23 +01:00
parent 7f4ec9a559
commit 9dae9a75bc
18 changed files with 13 additions and 62 deletions

View file

@ -164,12 +164,13 @@ GUI_control.prototype.content_ready = function (callback) {
$(elem).removeClass('togglemedium');
});
if (CONFIGURATOR.connectionValid) {
// Build link to in-use CF version documentation
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for INAV");
documentationButton.attr("href","https://github.com/iNavFlight/inav/wiki");
}
// Insert a documentation button next to the tab title
const tabTitle = $('div#content .tab_title');
const documentationDiv = $('<div>').addClass('cf_doc_version_bt');
$('<a>').attr('href', 'https://github.com/iNavFlight/inav/wiki')
.attr('target', '_blank').attr('id', 'button-documentation')
.html(chrome.i18n.getMessage('documentation')).appendTo(documentationDiv);
documentationDiv.insertAfter(tabTitle);
// loading tooltip
jQuery(document).ready(function($) {