fhemweb.js: fix "device specific help" after iOS <a> handling.

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@8943 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-07-12 06:37:31 +00:00
parent f3188eaf20
commit 10d629a865

View File

@@ -56,6 +56,23 @@ FW_jqueryReadyFn()
if(document.body.getAttribute("longpoll")) if(document.body.getAttribute("longpoll"))
setTimeout("FW_longpoll()", 100); setTimeout("FW_longpoll()", 100);
$("div.devSpecHelp a").each(function(){ // Help on detail window
var dev = $(this).attr("href").split("#").pop();
$(this).attr("href", "#");
$(this).click(function(evt){
if($("#devSpecHelp").length) {
$("#devSpecHelp").remove();
return;
}
$("#content").append('<div id="devSpecHelp"></div>');
FW_cmd(FW_root+"?cmd=help "+dev+"&XHR=1", function(data) {
$("#devSpecHelp").html(data);
var off = $("#devSpecHelp").position().top-20;
$('body, html').animate({scrollTop:off}, 500);
});
});
});
$("a").each(function() { FW_replaceLink(this); }) $("a").each(function() { FW_replaceLink(this); })
$("head script").each(function() { $("head script").each(function() {
var sname = $(this).attr("src"), var sname = $(this).attr("src"),
@@ -156,23 +173,6 @@ FW_jqueryReadyFn()
}); });
}); });
$("div.devSpecHelp a").each(function(){ // Help on detail window
var dev = $(this).attr("href").split("#").pop();
$(this).attr("href", "#");
$(this).click(function(evt){
if($("#devSpecHelp").length) {
$("#devSpecHelp").remove();
return;
}
$("#content").append('<div id="devSpecHelp"></div>');
FW_cmd(FW_root+"?cmd=help "+dev+"&XHR=1", function(data) {
$("#devSpecHelp").html(data);
var off = $("#devSpecHelp").position().top-20;
$('body, html').animate({scrollTop:off}, 500);
});
});
});
} }
@@ -350,7 +350,6 @@ FW_replaceLink(el)
attr = attr.replace(/'$/,''); attr = attr.replace(/'$/,'');
} }
var ma = attr.match(/^(.*\?)(cmd[^=]*=.*)$/); var ma = attr.match(/^(.*\?)(cmd[^=]*=.*)$/);
if(ma == null || ma.length == 0 || !ma[2].match(/=(save|set)/)) { if(ma == null || ma.length == 0 || !ma[2].match(/=(save|set)/)) {
ma = attr.match(new RegExp("^"+FW_root)); // Avoid "Connection lost" @iOS ma = attr.match(new RegExp("^"+FW_root)); // Avoid "Connection lost" @iOS