Skip to content

Commit

Permalink
Add loading indicator (and fix how it's hooked up).
Browse files Browse the repository at this point in the history
  • Loading branch information
belkadan committed Mar 24, 2012
1 parent 21b0c19 commit c5657e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,13 @@ blockquote cite {
a[href] img {
border: none;
}

.loading {
background-image:url(../images/loading);
background-repeat:no-repeat;
background-position:center center;
min-height:64px;
}
/* End Various Tags & Classes*/

/* Begin Headers */
Expand Down
Binary file added images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
layout: with_sidebar
body: search
title: Archives
dependencies: *
---
{% if site.tapir_token %}
<div class="shadow-box" id="search_results_area">
Expand Down Expand Up @@ -52,7 +51,7 @@ <h2>Posts <span id="result_count"></span></h2>
if (query) search_field.value = query[1]

var tapir_callback = function(results) {
search_results.className = '';
search_results.className = 'dates';
var resultCount = document.getElementById('result_count')
if (resultCount.textContent) resultCount.textContent = '(' + results.length + ')';
else resultCount.innerText = '(' + results.length + ')';
Expand All @@ -71,7 +70,7 @@ <h2>Posts <span id="result_count"></span></h2>
var query = search_field.value;
if (!query) return;

search_results.className = 'searching';
search_results.className = 'loading dates';
tapir(query, tapir_callback);
}

Expand All @@ -82,6 +81,6 @@ <h2>Posts <span id="result_count"></span></h2>
</script>
{% else %}
<div class="shadow-box" id="search_results_area">
<p>Search is not enabled on this site.
<p>Search is not enabled on this site.</p>
</div>
{% endif %}

0 comments on commit c5657e9

Please sign in to comment.