diff --git a/js/10-base.js b/js/10-base.js index 82b1d82a6..52b413058 100644 --- a/js/10-base.js +++ b/js/10-base.js @@ -36,6 +36,13 @@ Liberapay.init = function() { }); $('.navbar .dropdown-hover').removeClass('dropdown-hover'); + + $('.dropdown-toggle-form').click(function() { + var $this = $(this); + setTimeout(function() { + $this.siblings('.dropdown-menu').find('input').eq(0).focus(); + }, 10); + }); }; Liberapay.error = function(jqXHR, textStatus, errorThrown) { diff --git a/style/base/navbar.scss b/style/base/navbar.scss index bf9e63003..8aa83f445 100644 --- a/style/base/navbar.scss +++ b/style/base/navbar.scss @@ -54,6 +54,9 @@ & > .level2 > a { padding-left: 30px; } + .form-group { + margin: 0 10px; + } } .dropdown-hover .dropdown-menu { border-top-left-radius: 0; diff --git a/templates/base.html b/templates/base.html index 4cd81cd2d..aa96e4d5c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,6 +20,7 @@ % from 'templates/nav.html' import icon_span, nav, nav_about, nav_explore with context +% from 'templates/search.html' import search_form with context
{{ _("Whose work do you appreciate? See if they're on Liberapay:") }}
- % include "templates/search-box.html" + {{ search_form() }}{{ _("You can also pledge to people who haven't joined Liberapay yet:") }}
% include "templates/jump.html" diff --git a/www/search.spt b/www/search.spt index 010f6023b..b4af94138 100644 --- a/www/search.spt +++ b/www/search.spt @@ -72,6 +72,7 @@ if query: [---] text/html % extends "templates/base.html" % from 'templates/avatar-url.html' import avatar_url, avatar_img with context +% from 'templates/search.html' import search_form with context % block content % set usernames = results.get('usernames') @@ -84,7 +85,7 @@ if query: ) }} % endif - % include "templates/search-box.html" + {{ search_form(autofocus=True) }}