Skip to content

Commit

Permalink
Updates search field markup and style
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Rogers <[email protected]>
  • Loading branch information
chrissrogers committed Apr 11, 2014
1 parent f2d1387 commit 59ee05c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/javascripts/app/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

function bind () {
$('#search').on('keyup', function () {
$('#input-search').on('keyup', function () {
if (this.value) {
var items = index.search(this.value);
$('section, #toc .tocify-item').hide();
Expand Down
4 changes: 3 additions & 1 deletion source/layouts/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ under the License.
<body class="<%= page_classes %>">
<div class="tocify-wrapper">
<%= image_tag "logo.png" %>
<input type="text" id="search" placeholder="search">
<div class="search">
<input type="text" class="search" id="input-search">
</div>
<div id="toc">
</div>
<% if current_page.data.toc_footers %>
Expand Down
30 changes: 27 additions & 3 deletions source/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,37 @@ html, body {
// This is the logo at the top of the ToC
&>img {
display: block;
margin-bottom: $logo-margin;
}

&>.search {
position: relative;

input {
background: $nav-bg;
border-width: 0 0 1px 0;
border-color: $nav-footer-border-color;
padding: 6px 0 6px 20px;
box-sizing: border-box;
margin: 10px 15px;
width: $nav-width - 30;
outline: none;
color: $nav-text;
letter-spacing: 0.07em;
}

&:before {
@extend %icon-search;
position: absolute;
top: 16px;
left: 15px;
color: $nav-text;
}
}

.tocify-item>a, .toc-footer li {
padding: 0 $nav-padding 0 $nav-padding;
display:block;
overflow-x:hidden;
display: block;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
Expand Down

0 comments on commit 59ee05c

Please sign in to comment.