f18.js: change css positions to "normal desktop", change fixedInput default to false

git-svn-id: https://svn.fhem.de/fhem/trunk@17308 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-09-09 13:43:37 +00:00
parent 5139f76c2a
commit 640e3f444c
3 changed files with 19 additions and 23 deletions

View File

@ -3,7 +3,7 @@ FW_version["f18.js"] = "$Id$";
// TODO: hierMenu+Pin,SVGcolors,floorplan // TODO: hierMenu+Pin,SVGcolors,floorplan
// Known bugs: AbsSize is wrong for ColorSlider // 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); var f18_small = (screen.width < 480 || screen.height < 480);
$(window).resize(f18_resize); $(window).resize(f18_resize);
@ -80,7 +80,7 @@ f18_menu()
$("<div id='menuBtn'></div>").prependTo("div#menuScrollArea") $("<div id='menuBtn'></div>").prependTo("div#menuScrollArea")
.css( {"background-image":"url('"+f18_icon.bars+"')", "cursor":"pointer" }) .css( {"background-image":"url('"+f18_icon.bars+"')", "cursor":"pointer" })
.click(function(){ $("#menu").toggleClass("visible") }); .click(function(){ $("#menu").toggleClass("hidden") });
$("div#menu").prepend("<div></div>"); $("div#menu").prepend("<div></div>");
f18_addPin("div#menu > div:first", "menu", true, fixMenu, f18_small); f18_addPin("div#menu > div:first", "menu", true, fixMenu, f18_small);
@ -93,12 +93,13 @@ f18_menu()
f18_getAttr("hideLogo") ? "none" : "block"); f18_getAttr("hideLogo") ? "none" : "block");
if(f18_getAttr("Pinned.menu")) { if(f18_getAttr("Pinned.menu")) {
$("body").addClass("pinnedMenu"); $("body").addClass("pinnedMenu");
$("#menu").removeClass("visible"); $("#menu").removeClass("hidden");
$("#content").css("left", (parseInt($("div#menu").width())+20)+"px"); $("#content").css("left",
(parseInt($("div#menu").width())+2*f18_margin)+"px");
} else { } else {
$("body").removeClass("pinnedMenu"); $("body").removeClass("pinnedMenu");
$("#content").css("left", ""); $("#content").css("left", f18_margin);
} }
f18_resize(); f18_resize();
} }
@ -357,7 +358,7 @@ f18_special()
addHider("hidePin", true, "Hide pin", function(c){ addHider("hidePin", true, "Hide pin", function(c){
$("div.pinHeader div.pin").css("display", c ? "none":"block"); $("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<br>on small screen", addHider("wrapcolumns",false,"Wrap columns<br>on small screen",
f18_setWrapColumns); f18_setWrapColumns);
@ -374,16 +375,8 @@ f18_special()
function function
f18_setFixedInput() f18_setFixedInput()
{ {
$("#menu,#menuBtn,#content,#hdr") // togleClass is true for undefined
.css(f18_getAttr("fixedInput") ? $("body").toggleClass("fixedInput", f18_getAttr("fixedInput") ? true:false);
{ position:"fixed", overflow:"auto" } :
{ position:"absolute", overflow:"visible" });
}
function
f18_setFixedInput()
{
$("body").toggleClass("fixedInput", f18_getAttr("fixedInput"));
f18_resize(); f18_resize();
} }
@ -424,8 +417,10 @@ f18_resize()
display: hi ? "none":"block"}); display: hi ? "none":"block"});
$("#menu,#content").css("top", (hi && pm && hl) ? "10px" : "50px"); $("#menu,#content").css("top", (hi && pm && hl) ? "10px" : "50px");
$("#hdr").css({ left:(rm ? 10 : left)+'px' }); $("#hdr").css({ left:(rm ? 10 : left)+'px' });
$("#menuBtn").toggle(!pm || f18_small);
$("#menuBtn").css({ left:(rm ? "auto":"10px"), right:(rm ? "10px":"auto") }); $("#menuBtn").css({ left:(rm ? "auto":"10px"), right:(rm ? "10px":"auto") });
$("#logo") .css({ left:(rm ? "auto":lleft ), right:(rm ? "48px":"auto") }); $("#logo") .css({ left:(rm ? "auto":lleft ), right:(rm ? "48px":"auto") });
$("#menu").toggleClass("hidden", !pm);
} }
function function

View File

@ -6,19 +6,20 @@ textarea, .ui-dialog.ui-widget textarea { font-family:Courier; }
input,textarea { border-style:ridge; } input,textarea { border-style:ridge; }
input.maininput { margin-left:10px; } input.maininput { margin-left:10px; }
#logo { #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-image:url(../images/default/fhemicon.png);
background-size: contain; background-repeat: no-repeat; background-size: contain; background-repeat: no-repeat;
} }
#menuBtn { position: absolute; top:6.5px; left:10px; width:32px; height:32px; } #menuBtn { position: absolute; top:6.5px; left:10px; width:32px; height:32px;
#hdr { position: absolute; top:10px; left:48px; } display:none; }
#hdr { position: absolute; top:10px; left:40px; }
#content { #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-right: 10px;
padding-bottom: 10px; padding-bottom: 10px;
} }
#menu { #menu {
top:50px; bottom:10px; left:-120%; top:50px; bottom:10px; left:10px;
z-index:20; z-index:20;
display:inline-block; display:inline-block;
padding:0 0.5em 0.5em 0; padding:0 0.5em 0.5em 0;
@ -26,7 +27,7 @@ input.maininput { margin-left:10px; }
} }
#menu > table td { padding-top: 2px; } #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;} #console { width:100%; top:2em; bottom:0px; position:absolute; overflow-y:auto;}
#errmsg { background-color: #000000; color: #FFFFFF; #errmsg { background-color: #000000; color: #FFFFFF;
position:fixed; top:0px; left:40px; z-index: 10; } position:fixed; top:0px; left:40px; z-index: 10; }

View File

@ -1027,7 +1027,7 @@ FW_doUpdate(evt)
input = evt.data; input = evt.data;
FW_longpollOffset = 0; FW_longpollOffset = 0;
} else { } else if(FW_pollConn != undefined) {
if(FW_pollConn.readyState == 4 && !FW_leaving) { if(FW_pollConn.readyState == 4 && !FW_leaving) {
if(FW_pollConn.status == "400") { if(FW_pollConn.status == "400") {
location.reload(); location.reload();