sinatra-hexacta 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e93327f1a9af39595f3d181a38731f5426574cd7d9d3b78c5862a4e42179fff2
4
- data.tar.gz: 5689c062d590de61782ab4deb1932802a64ec70e6343f2d6b41eafef5cc8915f
3
+ metadata.gz: 728aa24903dfacd5848f5cf2fc1f88927f658951a69a5f92ef691851c42cd856
4
+ data.tar.gz: e80174daa95bb53cd75ad0478d96fde0ebbbb7616e2da79a6b52ec04378be60e
5
5
  SHA512:
6
- metadata.gz: 9cda35449a8c44fd63017fc8280be87e6eda0f4dfc46c52acb85cefccf1093901441654e01297e056fa5f35d0bee638e67f323639dd86f421dab50c2daf8a260
7
- data.tar.gz: 60109fb96322cf42c721fc4bec2d391d9499cb4ba593e8319c2e928e67ba57b92f43b6a567786a9e3bae991c84c7a35f7ad1d55709c62f68ca4856c706d88a67
6
+ metadata.gz: 6ad49dbe7dcf2d8b4863455ba676313a8963b5569a322e73e5e1401db20d4a8b537b32827ede670c228673a10a4d2c50e703d60e785f79b76dcdb3c3effb043d
7
+ data.tar.gz: 5d9a06abb2fce33e637f5a9b436139d6c466e6992ad6aa937ff5fc90025e567581db96000e5a6dab8ae264c48135619a51e20e41e343b49f2b9058e9bf1df8b4
@@ -21,6 +21,7 @@ class Finder {
21
21
  }
22
22
  }
23
23
 
24
+ var last_query = null;
24
25
  var header_input_timeout = null;
25
26
  $.xhrPool = [];
26
27
 
@@ -59,15 +60,20 @@ $(document).ready(function(){
59
60
  $('#header .results').click(function() {
60
61
  $("#header input").focus();
61
62
  });
62
-
63
63
  $('#header input').keyup(function() {
64
64
  clearTimeout(header_input_timeout);
65
65
 
66
66
  if($('#header input').val().length > 2 && $.trim($('#header input').val())) {
67
67
  header_input_timeout = setTimeout(function() {
68
68
  $.xhrPool.abortAll();
69
- Finder.find($('#header input').val());
70
- }, 500);
69
+ if (last_query != $.trim($('#header input').val())) {
70
+ last_query = $.trim($('#header input').val());
71
+ console.log(last_query);
72
+ if (last_query.length > 2) {
73
+ Finder.find(last_query);
74
+ }
75
+ }
76
+ }, 1000);
71
77
  }
72
78
  });
73
79
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-hexacta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger