TPAC: Add a progress spinner after pressing search on Advanced Search
authorMichael Peters <mrpeters@library.in.gov>
Fri, 21 Sep 2012 15:47:41 +0000 (11:47 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 11 Oct 2012 15:11:37 +0000 (11:11 -0400)
Advanced Search had no indication of progress once you've submitted
a search. We should add a "progressbar_green.gif" like the basic search
has, so the user knows their search is in progress, and (hopefully)
avoids them from hammering submit to get a result.

Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/opac/parts/advanced/search.tt2

index 5af1d2e..e90b6d3 100644 (file)
     </tr>
 </table>
 <input type="hidden" name="_adv" value="1" />
-<input type="submit" value="[% l('Search') %]" class='pointer opac-button' />
+           <span>
+            <input id='search-submit-go' type="submit" value="[% l('Search') %]" alt="[% l('Search') %]" class="opac-button"
+                onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
+            <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt=''/>
+          </span>
+
 <a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
     class="pointer opac-button">[% l('Clear Form') %]</a>
 </form>