Permalink
Browse files

- added a clear button

  • Loading branch information...
1 parent 5b5b33b commit a7825c0d5117ecf3fc2b5fb1770da41d70116ad2 Jason Bruce committed May 29, 2012
Showing with 16 additions and 1 deletion.
  1. +2 −1 septic_tank/sample_solr_configs/search.html
  2. +14 −0 septic_tank/sample_solr_configs/search.js
@@ -80,7 +80,8 @@
<div class="row">
<div class="column"></div>
- <div class="column"><button id="submit" type="submit">Submit</button></div>
+ <div class="column"><button id="submit" type="submit">Submit</button>
+ <button id="clear" type="submit">Clear</button></div>
</div><!--end row-->
</div><!--end column-->
@@ -689,6 +689,16 @@ this.redirect = function() {
window.location = url + "?" + this.browser_params();
}
+//----------------------------------------------------------------------------
+// clear all parameters and start over clean
+//----------------------------------------------------------------------------
+this.clear = function() {
+ var url = window.location+"";
+ // remove the query string
+ url = url.split("?")[0];
+ window.location = url;
+ }
+
this.set_defaults();
if(size(this.params)==0) {
this.redirect();
@@ -716,6 +726,10 @@ $("#submit").click(function() {
ss.query();
});
+$("#clear").click(function() {
+ ss.clear();
+ });
+
$("#start").datetimepicker({
showSecond: true,
timeFormat: 'hh:mm:ss',

0 comments on commit a7825c0

Please sign in to comment.