diff --git a/fhem/www/pgm2/f18.js b/fhem/www/pgm2/f18.js index 773566d83..1cee80e30 100644 --- a/fhem/www/pgm2/f18.js +++ b/fhem/www/pgm2/f18.js @@ -3,7 +3,7 @@ FW_version["f18.js"] = "$Id$"; // TODO: hierMenu+Pin,SVGcolors,floorplan // Known bugs: AbsSize is wrong for ColorSlider -var f18_attr={}, f18_sd, f18_icon={}, f18_room, f18_grid=20; +var f18_attr={}, f18_sd, f18_icon={}, f18_room, f18_grid=20, f18_margin=10; var f18_small = (screen.width < 480 || screen.height < 480); $(window).resize(f18_resize); @@ -80,7 +80,7 @@ f18_menu() $("").prependTo("div#menuScrollArea") .css( {"background-image":"url('"+f18_icon.bars+"')", "cursor":"pointer" }) - .click(function(){ $("#menu").toggleClass("visible") }); + .click(function(){ $("#menu").toggleClass("hidden") }); $("div#menu").prepend("
"); f18_addPin("div#menu > div:first", "menu", true, fixMenu, f18_small); @@ -93,12 +93,13 @@ f18_menu() f18_getAttr("hideLogo") ? "none" : "block"); if(f18_getAttr("Pinned.menu")) { $("body").addClass("pinnedMenu"); - $("#menu").removeClass("visible"); - $("#content").css("left", (parseInt($("div#menu").width())+20)+"px"); + $("#menu").removeClass("hidden"); + $("#content").css("left", + (parseInt($("div#menu").width())+2*f18_margin)+"px"); } else { $("body").removeClass("pinnedMenu"); - $("#content").css("left", ""); + $("#content").css("left", f18_margin); } f18_resize(); } @@ -357,7 +358,7 @@ f18_special() addHider("hidePin", true, "Hide pin", function(c){ $("div.pinHeader div.pin").css("display", c ? "none":"block"); }); - addHider("fixedInput", true, "Fixed input and menu", f18_setFixedInput); + addHider("fixedInput", false, "Fixed input and menu", f18_setFixedInput); addHider("wrapcolumns",false,"Wrap columns
on small screen", f18_setWrapColumns); @@ -374,16 +375,8 @@ f18_special() function f18_setFixedInput() { - $("#menu,#menuBtn,#content,#hdr") - .css(f18_getAttr("fixedInput") ? - { position:"fixed", overflow:"auto" } : - { position:"absolute", overflow:"visible" }); -} - -function -f18_setFixedInput() -{ - $("body").toggleClass("fixedInput", f18_getAttr("fixedInput")); + // togleClass is true for undefined + $("body").toggleClass("fixedInput", f18_getAttr("fixedInput") ? true:false); f18_resize(); } @@ -424,8 +417,10 @@ f18_resize() display: hi ? "none":"block"}); $("#menu,#content").css("top", (hi && pm && hl) ? "10px" : "50px"); $("#hdr").css({ left:(rm ? 10 : left)+'px' }); + $("#menuBtn").toggle(!pm || f18_small); $("#menuBtn").css({ left:(rm ? "auto":"10px"), right:(rm ? "10px":"auto") }); $("#logo") .css({ left:(rm ? "auto":lleft ), right:(rm ? "48px":"auto") }); + $("#menu").toggleClass("hidden", !pm); } function diff --git a/fhem/www/pgm2/f18style.css b/fhem/www/pgm2/f18style.css index 9ebf0b454..898288833 100644 --- a/fhem/www/pgm2/f18style.css +++ b/fhem/www/pgm2/f18style.css @@ -6,19 +6,20 @@ textarea, .ui-dialog.ui-widget textarea { font-family:Courier; } input,textarea { border-style:ridge; } input.maininput { margin-left:10px; } #logo { - position:absolute; top:6.5px; left:50px; width:32px; height:32px; z-index:10; + position:absolute; top:6.5px; left:10px; width:32px; height:32px; z-index:10; background-image:url(../images/default/fhemicon.png); background-size: contain; background-repeat: no-repeat; } -#menuBtn { position: absolute; top:6.5px; left:10px; width:32px; height:32px; } -#hdr { position: absolute; top:10px; left:48px; } +#menuBtn { position: absolute; top:6.5px; left:10px; width:32px; height:32px; + display:none; } +#hdr { position: absolute; top:10px; left:40px; } #content { - position: absolute; top:50px; left:10px; bottom:0; right: 0; + position: absolute; top:50px; left:130px; bottom:0; right: 0; padding-right: 10px; padding-bottom: 10px; } #menu { - top:50px; bottom:10px; left:-120%; + top:50px; bottom:10px; left:10px; z-index:20; display:inline-block; padding:0 0.5em 0.5em 0; @@ -26,7 +27,7 @@ input.maininput { margin-left:10px; } } #menu > table td { padding-top: 2px; } -#menu.visible { left:10px!important; } +#menu.hidden { left:-120%!important; } #console { width:100%; top:2em; bottom:0px; position:absolute; overflow-y:auto;} #errmsg { background-color: #000000; color: #FFFFFF; position:fixed; top:0px; left:40px; z-index: 10; } diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index c6eab0c29..e57bc7d53 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -1027,7 +1027,7 @@ FW_doUpdate(evt) input = evt.data; FW_longpollOffset = 0; - } else { + } else if(FW_pollConn != undefined) { if(FW_pollConn.readyState == 4 && !FW_leaving) { if(FW_pollConn.status == "400") { location.reload();