From 8a894bba5118c78e2be821606535fd5ea668caf9 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 12 Jul 2015 06:37:31 +0000 Subject: [PATCH] fhemweb.js: fix "device specific help" after iOS handling. git-svn-id: https://svn.fhem.de/fhem/trunk@8943 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/fhemweb.js | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 26651d875..965010091 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -56,6 +56,23 @@ FW_jqueryReadyFn() if(document.body.getAttribute("longpoll")) 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('
'); + 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); }) $("head script").each(function() { 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('
'); - 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(/'$/,''); } - var ma = attr.match(/^(.*\?)(cmd[^=]*=.*)$/); if(ma == null || ma.length == 0 || !ma[2].match(/=(save|set)/)) { ma = attr.match(new RegExp("^"+FW_root)); // Avoid "Connection lost" @iOS