Skip to content

Commit c24095a

Browse files
committed
Focus on search when you press /
1 parent a4a97a1 commit c24095a

File tree

8 files changed

+58
-13
lines changed

8 files changed

+58
-13
lines changed

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var elixir = require('laravel-elixir');
1313

1414
elixir(function(mix) {
1515
mix.sass('laravel.scss', 'public/assets/css');
16-
mix.scripts(['jquery.js', 'plugins/prism.js', 'plugins/bootstrap.js', 'plugins/scotchPanels.js', 'plugins/algoliasearch.js', 'plugins/typeahead.js', 'plugins/hogan.js', 'laravel.js'],
16+
mix.scripts(['jquery.js', 'plugins/prism.js', 'plugins/bootstrap.js', 'plugins/scotchPanels.js', 'plugins/algoliasearch.js', 'plugins/typeahead.js', 'plugins/hogan.js', 'plugins/mousetrap.js', 'laravel.js'],
1717
'public/assets/js/laravel.js',
1818
'resources/assets/js/');
1919
mix.version(['assets/css/laravel.css', 'assets/js/laravel.js']);

public/assets/js/laravel.js

+18-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/js/laravel.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/js/laravel-01156b2f.js renamed to public/build/assets/js/laravel-17d3476a.js

+18-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/assets/js/laravel.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/rev-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"assets/css/laravel.css": "assets/css/laravel-b2b0f00c.css",
3-
"assets/js/laravel.js": "assets/js/laravel-01156b2f.js"
3+
"assets/js/laravel.js": "assets/js/laravel-17d3476a.js"
44
}

resources/assets/js/laravel.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ $(function() {
3737

3838
// gheading links
3939
$('.docs-wrapper').find('a[name]').each(function () {
40-
var anchor = $('<a href="#' + this.name + '"/>');
41-
$(this).parent().next('h2').wrapInner(anchor);
42-
});
40+
var anchor = $('<a href="#' + this.name + '"/>');
41+
$(this).parent().next('h2').wrapInner(anchor);
42+
});
43+
44+
Mousetrap.bind('/', function(e) {
45+
$('#search-input').focus();
46+
}, 'keyup');
4347

4448
initAlgoliaSearch();
4549

resources/assets/js/plugins/mousetrap.js

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)