// Add close button to menu
this.getElement().prepend(this.getMenuCloseButton());
this.initBurger();
+
+ // Add class if search is float
+ if(this.fluidbook.settings.search_field === "float") {
+ $('body').addClass('floatmode');
+ }
},
initNav() {
// Add holder list element for menu items
$("#menu").append('<div id="menuList"' + v2 + '><ul></ul></div>');
+ },
+ initSearch: function() {
// Add Search form
var searchElement = (this.fluidbook.settings.search) ? this.getSearch() : '';
- this.searchHTML = '<div id="menuSearch">' + searchElement + '</div>'; // Save for later so it can be injected after MMenu is rendered
+ const searchHtml = '<div id="menuSearch">' + searchElement + '</div>'; // Save for later so it can be injected after MMenu is rendered
+ $('body').append(searchHtml);
},
initBurger: function () {
// MMenu specific elements
if (navType === 'menu') {
this.burger.initNav();
+ this.burger.initSearch();
if (this.fluidbook.settings.navOrderH.length > 0) {
navOrder = this.fluidbook.settings.navOrderH;
}
});
this.initResultsNav();
+
+ console.log("search",$this.fluidbook.nav)
},
debugSearch: function (keyword) {
if (!this.hintsEnabled) {
return;
}
- this.menuSearchHints = $('#menuSearchHints');
+ this.menuSearchHints = $('#menuSearchHints, #menuSearch');
this.fluidbook.nav.burger.hideMenuItems(); // Hide menu items to give space for hints div
this.menuSearchHints.fadeIn(300);
// Fluidbook menu styles
#menu {
transition: left 0.4s ease, right 0.4s ease;
- background-color: @menu-background;
+ background-color: transparent; //@menu-background;
color: @menu-text;
box-shadow: rgba(0, 0, 0, 0.2) -5px 6px 13px 0px; // ToDo: adjust drop-shadow depending on which side the menu comes from
width: 320px;
&.open {
transition: left 0.4s, right 0.4s;
left: 0;
+ background: transparent;
+ box-shadow: none;
}
a, li > span {
}
#menuSearch {
+ display: none;
position: absolute;
- top: 0;
- left: 0;
+ top: 30px;
+ left: 50%;
+ transform: translate(-50%, 0);
width: 100%;
- z-index: 2; // Ensure search box sits above #shareLinks
+ max-width: 400px;
+ //z-index: 2; // Ensure search box sits above #shareLinks
+ background-color: @menu-field-background;
+ border-radius: 8px;
+ overflow: hidden;
+ box-shadow: rgba(0, 0, 0, 0.2) -5px 6px 13px 0px;
+ z-index: 999;
&:after {
border: none;
height: 60px;
padding: 21px 21px 23px 23px !important; // Controls size of icon and position within the element
color: @menu-text;
- .button-hover();
+ //.button-hover();
cursor: pointer;
z-index: 3;
left: 0;
top: 50%;
transform: translateY(-50%);
- color: @menu-background;
+ color: @menu-text;
height: auto;
- padding-top: 20px;
+ padding-left: 20px !important;
.svg-icon {
width: 25px;
}
#menuSearchHints {
- padding: 15px 0;
+
+ &:has(.hint) {
+ padding: 10px 0;
+ margin: 0 10px;
+ border-top: 1px solid darken(#fff, 80%);
+ }
.hint {
- padding: 13px 30px;
+ padding: 10px 15px;
font-size: 16px;
display: block;
width: 100%;
margin: auto;
top: 0;
bottom: 0;
- right: 25px;
+ right: 15px;
transform: rotate(135deg);
// Reverse arrow position and direction for RTL screens