From 2c238f49e0ef7cee303d0ab2f08cd38f9f9d7984 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 31 Aug 2013 02:59:45 +0800 Subject: [PATCH] added search button, hiding the form by default. also fixes issue #241 notes: mobile needs a dedicated notification screen, imo, rather than using the same popup. and /search needs a form on the page itself. --- public/css/style.less | 17 ++++++++++------- public/src/forum/footer.js | 12 +++++++++++- public/templates/header.tpl | 28 +++++++++++++++++----------- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/public/css/style.less b/public/css/style.less index d3697fdb95..63d77b030a 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -136,10 +136,6 @@ footer.footer { } } -#right-menu{ - float:right; -} - #chat-content { height:200px; resize:none; @@ -257,6 +253,11 @@ footer.footer { /* END: post-window needs to go in its own plugin area */ +//theme +#search-form .btn-link { + color: white; +} + //START: FIXES FOR BS3, may need to remove these when we get out of the RC releases @media (max-width: 979px) { @@ -266,9 +267,11 @@ footer.footer { } } -.container > .navbar-header, .container > .navbar-collapse { - padding-right: 0; - margin-right: -11px; +@media (min-width: 760px) { + .container > .navbar-header, .container > .navbar-collapse { + padding-right: 0; + margin-right: -11px; + } } .badge { diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index 4a1b52fdd5..a67b349118 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -44,6 +44,16 @@ socket.on('api:updateHeader', function(data) { + jQuery('#search-button').on('click', function() { + jQuery('#search-fields').removeClass('hide').show(); + jQuery(this).hide(); + jQuery('#search-fields input').focus() + + jQuery('#search-form').on('submit', function() { + jQuery('#search-fields').hide(); + jQuery('#search-button').show(); + }); + }); var rightMenu = $('#right-menu'), isLoggedIn = data.uid > 0; @@ -167,7 +177,7 @@ modal = chat.getModal(data.fromuid); chat.appendChatMessage(modal, data.message, data.timestamp); } else { - modal = chat.createModal(data.username, data.fromuid); + modal = chat.createModal(data.username, data.fromuid); } chat.load(modal.attr('UUID')); diff --git a/public/templates/header.tpl b/public/templates/header.tpl index c40ae52c36..71d6fe93d8 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -53,29 +53,35 @@
  • Users
  • +
  • - + +