From 063c0537cca2a32908e03b585ba286ea7c9fc291 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Thu, 9 Jul 2015 13:53:11 +0000 Subject: [PATCH] fhemweb.js: remove "Connection lost" messages on iOS when changing the room git-svn-id: https://svn.fhem.de/fhem/trunk@8928 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/fhemweb.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 58ae7bdbc..4a15ec960 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -349,9 +349,19 @@ FW_replaceLink(el) attr = attr.replace(/^location.href='/,''); attr = attr.replace(/'$/,''); } + + 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 + if(ma) { + $(el).click(function() { + FW_leaving = 1; + location.href = attr; + }); + } return; + } $(el).removeAttr("href"); $(el).removeAttr("onclick"); $(el).click(function() {