2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhemweb.js: add outer li for help (Forum #93243)

git-svn-id: https://svn.fhem.de/fhem/trunk@17748 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-11-15 11:04:58 +00:00
parent e573c52a08
commit 0e85dd0933

View File

@ -295,16 +295,20 @@ FW_jqueryReadyFn()
return; return;
$("#devSpecHelp").remove(); $("#devSpecHelp").remove();
var sel = this; var sel = this;
FW_getHelp(m[2], function(data) { FW_getHelp(m[2], function(data) { // show either the next or the outer li
$("#content") $("#content")
.append("<div id='workbench' style='display:none'></div>"); .append("<div id='workbench' style='display:none'></div>");
$("#content > #workbench").html(data); $("#content > #workbench").html(data);
var aTag = $("#content > #workbench").find("a[name="+val+"]"); var aTag = $("#content > #workbench").find("a[name="+val+"]");
if($(aTag).length) {
if($(aTag).length && $(aTag).next("li").length) { var liTag = $(aTag).next("li");
if(!$(liTag).length)
liTag = $(aTag).parent("li");
if($(liTag).length) {
$(sel).closest("div[cmd='"+m[1]+"']") $(sel).closest("div[cmd='"+m[1]+"']")
.after('<div class="makeTable" id="devSpecHelp"></div>') .after('<div class="makeTable" id="devSpecHelp"></div>')
$("#devSpecHelp").html($(aTag).next("li").html()); $("#devSpecHelp").html($(liTag).html());
}
} }
$("#content > #workbench").remove(); $("#content > #workbench").remove();
}); });