diff --git a/bin/css/style.css b/bin/css/style.css index 93ff87aeaf16e72187bb3e7568c6818e2bca7a7d..e89fa1f9a28cd6c9bcc4d6e6cc6d8aba4eb0c0db 100644 --- a/bin/css/style.css +++ b/bin/css/style.css @@ -644,6 +644,16 @@ a.toTop:before { } } +/* mobile search */ +.quiqqer-products-mobileSuggest-results ul { + padding: 0; +} + +.quiqqer-products-mobileSuggest-container input[type="search"]:focus, +.quiqqer-products-mobileSuggest-container input[type="text"]:focus { + background: #303134; +} + /** header ===================================== */ diff --git a/bin/javascript/init.js b/bin/javascript/init.js index 2564ae4cc0b4d662df7fcc0f7bacbe7b7ae0e7d0..3e2f875d84f027e4c0a803b013216b4c7ce6333a 100644 --- a/bin/javascript/init.js +++ b/bin/javascript/init.js @@ -217,20 +217,29 @@ window.addEvent('domready', function () { * Sticky menu * @type {boolean} */ - var Menu = document.getElement('.cologne-header'), - topBarHeight = document.getElement('.topbar').getSize().y, - isMenuSticked = false, - SearchBtn = document.getElement('.cologne-header .search-button'), - SearchInput = document.getElement('.template-search input[type="search"]'); + var Menu = document.getElement('.cologne-header'), + topBarHeight = document.getElement('.topbar').getSize().y, + isMenuSticky = false, + SearchBtn = document.getElement('.cologne-header .search-button'), + SearchInput = document.getElement('.template-search input[type="search"]'); if (SearchBtn && SearchInput) { - SearchBtn.addEvent('click', function () { + + var clickEvent = function () { new Fx.Scroll(window, { onComplete: function () { SearchInput.focus(); } }).toTop(); - }); + }; + + if (QUI.getWindowSize().x < 767) { + clickEvent = function () { + document.getElement('.quiqqer-products-search-suggest-form-button').click(); + }; + } + + SearchBtn.addEvent('click', clickEvent); } /** @@ -255,7 +264,7 @@ window.addEvent('domready', function () { Menu.addClass('cologne-header-fixed'); document.body.addClass('header-fixed'); - isMenuSticked = true; + isMenuSticky = true; }; var showSearchBtn = function () { @@ -281,13 +290,13 @@ window.addEvent('domready', function () { Menu.removeClass('cologne-header-fixed'); Menu.setStyle('position', null); document.body.removeClass('header-fixed'); - isMenuSticked = false; + isMenuSticky = false; }; if (Menu) { // check on page load if menu should be sticked to the top if (QUI.getScroll().y >= topBarHeight) { - if (isMenuSticked) { + if (isMenuSticky) { return; } @@ -297,7 +306,7 @@ window.addEvent('domready', function () { QUI.addEvent('scroll', function () { if (QUI.getScroll().y >= topBarHeight) { - if (isMenuSticked) { + if (isMenuSticky) { return; } @@ -306,7 +315,7 @@ window.addEvent('domready', function () { return; } - if (!isMenuSticked) { + if (!isMenuSticky) { return; }