From fa606bd89fb44fd23168ef427e88ff49af79057d Mon Sep 17 00:00:00 2001 From: Neerholt Date: Tue, 25 Aug 2020 12:00:10 +0200 Subject: [PATCH] v0.10.14h - Added tooltips to navbar --- skolehjem/public/css/admin.css | 8 +- skolehjem/resources/sass/admin/nav/nav.scss | 12 +- .../views/admin/layout/base.blade.php | 178 +++++++++--------- 3 files changed, 96 insertions(+), 102 deletions(-) diff --git a/skolehjem/public/css/admin.css b/skolehjem/public/css/admin.css index ee7f16d..7803f31 100644 --- a/skolehjem/public/css/admin.css +++ b/skolehjem/public/css/admin.css @@ -6667,7 +6667,7 @@ main { background-color: #00788A; } -.segment > h3 { +.segment > div > h3 { margin-left: -1rem; margin-top: 0; width: calc(100% + 1rem); @@ -6675,12 +6675,12 @@ main { font-size: 1.15em; } -.segment > h3 > a { +.segment > div > h3 > a { padding: 1rem 2rem; display: flex; } -.segment > h3 > a > img { +.segment > div > h3 > a > img { width: 1.5em; } @@ -6691,7 +6691,7 @@ main { margin-bottom: .5rem;*/ } -.segment > h3:hover { +.segment > div > h3:hover { background-color: rgba(0, 0, 0, 0.2); } diff --git a/skolehjem/resources/sass/admin/nav/nav.scss b/skolehjem/resources/sass/admin/nav/nav.scss index be2c737..44a326e 100644 --- a/skolehjem/resources/sass/admin/nav/nav.scss +++ b/skolehjem/resources/sass/admin/nav/nav.scss @@ -13,7 +13,7 @@ div.w-85 { background-color: #00788A; } -.segment > h3 { +.segment > div > h3 { margin-left: -1rem; margin-top: 0; width: calc(100% + 1rem); @@ -21,12 +21,12 @@ div.w-85 { font-size: 1.15em; } -.segment > h3 > a { +.segment > div > h3 > a { padding: 1rem 2rem; display: flex; } -.segment > h3 > a > img { +.segment > div > h3 > a > img { width: 1.5em; } @@ -37,7 +37,7 @@ div.w-85 { margin-bottom: .5rem;*/ } -.segment > h3:hover { +.segment > div > h3:hover { background-color: rgba(0,0,0, 0.2); } @@ -46,10 +46,6 @@ div.w-85 { padding-right: 8px; } -.segment > div > a { - -} - .btn-inline { display: inline-flex; align-items: center; diff --git a/skolehjem/resources/views/admin/layout/base.blade.php b/skolehjem/resources/views/admin/layout/base.blade.php index b34963c..85bb23a 100644 --- a/skolehjem/resources/views/admin/layout/base.blade.php +++ b/skolehjem/resources/views/admin/layout/base.blade.php @@ -20,11 +20,19 @@ var w85 = document.getElementsByClassName("w-85")[0]; $(".w-85").css({ "width": "85%" }); - $(".segment > h3").css({"margin-left": "", "width": ""}); - $(".segment > h3 > a").css({ "display": ""}); - $(".segment > h3 > a > span").css({"display": ""}); + $(".segment > div > h3").css({"margin-left": "", "width": ""}); + $(".segment > div > h3 > a").css({ "display": ""}); + $(".segment > div > h3 > a > span").css({"display": ""}); - $(".segment > div").css({"margin-left": "-1rem", "padding": "1rem 0rem 1rem 2rem", "width": "calc(100% - 3rem)"}); + $(document).on({ + mouseenter: function() { + $(this).find('.tooltiptext').css("visibility", "hidden"); + }, + mouseleave: function() { + $(this).find('.tooltiptext').css("visibility", "hidden"); + } + }, ".tooltip"); + $(".segment .hamburger > div").css({"margin-left": "-1rem", "width": "calc(100% - 3rem)"}); $(".segment > div > a").css({"margin-left": "auto", "margin-right": ""}); localStorage.setItem("collapsed", "false"); @@ -46,11 +54,20 @@ var w85 = document.getElementsByClassName("w-85")[0]; $(".w-85").css({ "width": "calc(100% - 64px)"}); - $(".segment > h3").css({"margin-left": "0", "width": "100%"}); - $(".segment > h3 > a").css({"display": "flex"}); - $(".segment > h3 > a > span").css({"display": "none"}); + $(".segment > div > h3").css({"margin-left": "0", "width": "100%"}); + $(".segment > div > h3 > a").css({"display": "flex"}); + $(".segment > div > h3 > a > span").css({"display": "none"}); - $(".segment > div").css({"margin-left": "0", "padding": "1rem 0", "width": "100%"}); + $(document).on({ + mouseenter: function() { + $(this).find('.tooltiptext').css("visibility", "visible"); + }, + mouseleave: function() { + $(this).find('.tooltiptext').css("visibility", "hidden"); + } + }, ".tooltip"); + + $(".segment.hamburger > div").css({"margin-left": "0", "width": "calc(100% - 4rem)"}); $(".segment > div > a").css({"margin-left": "auto", "margin-right": "auto"}); localStorage.setItem("collapsed", "true"); @@ -66,102 +83,80 @@ + @yield("header")