diff options
author | Alberto GarcĂa Hierro <alberto@garciahierro.com> | 2020-05-01 00:38:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-01 00:38:02 +0300 |
commit | 84cad97feb327372444496adde8b900c4ba1dcb9 (patch) | |
tree | 124b4210750dc66a7587e544107102bee3e3e079 /js | |
parent | 680ae6a169c0a81f16d7d4d5b04945de648240bf (diff) | |
parent | 9dae9a75bcc5b69a40c2f0aa50f9bbc322f54265 (diff) |
Merge pull request #955 from iNavFlight/agh_documentation_link
[TABS] Generate the documentation link dynamically via JS
Diffstat (limited to 'js')
-rw-r--r-- | js/gui.js | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -165,12 +165,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($) { |