Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Added search to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Dec 15, 2015
1 parent 4621c42 commit 1bbaf15
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/public/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/public/js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions app/views/templates/normal.jade
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ block body
| SpringRoll Connect
small.version.hidden-xs v#{version}
.navbar-collapse.collapse
if user && user.privilege >= privilege.editor
form.navbar-form.search.hidden-sm.hidden-xs
.input-group
.input-group-addon
span.glyphicon.glyphicon-search
input.form-control#allGameSearch(
type="text"
placeholder="Search for games"
data-search="/games/search"
data-list="#allGameSearchDisplay"
data-field="title"
autofocus
tabIndex=1
autocomplete="off")
.dropdown.search#allGameSearchDisplay
ul.dropdown-menu
ul.nav.navbar-nav.navbar-right
if user
if user.privilege >= privilege.editor
Expand Down
16 changes: 16 additions & 0 deletions src/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ h2, h3, h4 {
}
}

form.search {
float:right;
display:inline-block;
padding-right:0;
.search-item {
color: #337ab7 !important;
&:hover {
color:#23527c !important;
text-decoration: underline;
}
}
.active .search-item {
color:#fff !important;
}
}

.navbar-brand {
.version {
background: #333;
Expand Down
10 changes: 10 additions & 0 deletions src/widgets/search-games-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(function()
{
// User searching add result
var games = $("#games");
var gameTemplate = $("#gameTemplate").html();
$("#allGameSearch").on('search', function(e, game)
{
location.href = "/games/game/" + game.slug;
});
}());

0 comments on commit 1bbaf15

Please sign in to comment.