mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 11:29:53 +03:00
Let help icons click through to settings
This commit is contained in:
parent
9e16652980
commit
8429b51d6e
8 changed files with 175 additions and 166 deletions
|
@ -508,6 +508,8 @@ var Settings = (function () {
|
|||
self.processHtml = function(callback) {
|
||||
return function() {
|
||||
self.configureInputs().then(callback);
|
||||
self.linkHelpIcons();
|
||||
//self.configureInputs().then(self.linkHelpIcons().then(callback));
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -515,5 +517,30 @@ var Settings = (function () {
|
|||
return $('[data-setting="' + settingName + '"]').val();
|
||||
};
|
||||
|
||||
self.linkHelpIcons = function() {
|
||||
var helpIcons = [];
|
||||
$('.helpicon').each(function(){
|
||||
helpIcons.push($(this));
|
||||
});
|
||||
|
||||
return Promise.mapSeries(helpIcons, function(helpIcon, ii) {
|
||||
let forAtt = helpIcon.attr('for');
|
||||
|
||||
if (typeof forAtt !== "undefined" && forAtt !== "") {
|
||||
let dataSettingName = $('#' + forAtt).data("setting");
|
||||
|
||||
if (typeof dataSettingName === "undefined" || dataSettingName === "") {
|
||||
dataSettingName = $('#' + forAtt).data("setting-placeholder");
|
||||
}
|
||||
|
||||
if (typeof dataSettingName !== "undefined" && dataSettingName !== "") {
|
||||
helpIcon.wrap('<a class="helpiconLink" href="https://github.com/iNavFlight/inav/blob/master/docs/Settings.md#' + dataSettingName + '" target="_blank"></a>');
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
||||
return self;
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue