From 8db4458ab5f2bfa1a5caa8a2fa37efd81624c1b0 Mon Sep 17 00:00:00 2001 From: Dave Gandy Date: Tue, 1 Sep 2015 16:11:16 -0400 Subject: [PATCH] adding debounce to algolia search --- assets/font-awesome-4.4.0.zip | Bin 534967 -> 534967 bytes assets/js/search.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/font-awesome-4.4.0.zip b/assets/font-awesome-4.4.0.zip index 8f3663cb4946944f42561eab9f538712c1e2081d..a286e8eaa4a4c77ed9401b82a8dae0ed59249deb 100644 GIT binary patch delta 1642 zcmZ9LT}YE*6vy}O>zu@_sI+Z5=f`wfnU;jw)KQX_71LVbMWGZSMO|Aru}T(EP)I#j zS?Wc#O3jMrqAtAB(u~R?>O#tN7@1;dQ0nM;=AOMDyZoJV{?GsX-!nSwpu>)MZ?(Y~ zr{ljG|MmD>C^mr%nY7d= zv96YV1^G%zKH1V%P$}4j=>j@kAkD=yPC{i;tPm(HmuO+RKJPZK92?Qgm7Wnj?HMu5 zyLqL{W~>rofw0X;!#2~AQeHVyXWAtyw6o6iWuDW^K6AOCfww+0ed`13eqNcp2gRa7 zHr$6_9NL1gDF#_2R=w9xP6fdYMbS9AgYc2VzysJ3gYO=|EQkFMp-4b#egrOw)BH{- z7nFP+hmEA86ZY`ROec6^m7*?~;c$I7GZuZ0p6rJ9wVbZ#gAzfBw+~)(Xz!QbBZvE8 zJi+TvtDJjP{4^lxbgc%`5CRMF1i?g3zl4=yo;JUPHi_@+8ejs^6S#2=ZS?#A7$c@H z4J!6~KM241dws8An-C#5w6t`12ucN{+uuO`>S&Tq(wmK@c;A6#I)mcOBANDmlZQy$ zD174b-$$WBD3QGH@Q1^!F-085#~@dVEII4_I#JKAxJgHPlh96Hj6-54KKzH=h-!MNXvQXaX&6K ze`S8|kf~8{kUSSA#<9J{*(^%{z1$o>bha z0(Vo{E6S0z4&0{#7aiF3ootcCi~%X6ng_8oQo@S^oilX%83x delta 1642 zcmZ9LOH5Ni6o&ic90|Un0&Srduuxw-lo(VVjS59UQ`Bl$NI=jSjV=kgG4YWaqltvz ztVGd;S`iR6v(SYrKoEkWF}fg%mS{u>0w#(y&fIo-A9wkk|D5^HKXd7@gAP05yk$mH ztd4)h^^I|B;P7z~nl?zq_LxDnp9!+*7GSYO%vJL9Os>kD& z>I6e^ebb(tY~@HRXRSFNs0r)NPv+3c9Q|w@<7BK*?-62uZjqkm78x>c@=D!^L9TR- z7--jsaW0=%I&7xWXivyyq9L2Ps(@FjD$P4Zg|=6kKhAM_*%wnJsDH>8Lx+4|-N!5A z_h7TAkahRrCx^BGWJMv1g!?Ba1CTEkAe{kt$D#iLY>&d%4`7DFo;Ju6kj6X&m!8w? zb|?~*dt`AI7 zBxi=Ws13bu+N1P8)PhX$ZPK)P)ZvX^lwOVUYRWS}|Dw|{}osCZ^lrrn?A zCK5Xe?|ILcQP?3Sk<2gfo5S?4ia3sbg*AF<$rY101A^v&z%;E8ntfXxrxXq(!_G0wmJiUev{X!mk z?DtC-KQTYI$iyf(NTv(pW7*!3dnEIE{L3f)F`)dG@{Ksl;YJe{3h%VRgj=KppCq9C zIOY;?f=hoSVjd5Z)L1cz{e)zP1@n#UUnNVE!=TlIn&rMZHBKwiH9nrDYi6WnXcSj7 fBKIPE%w}kO9CK;zW!S~um@-rM>WHz%)tLStmj{XR diff --git a/assets/js/search.js b/assets/js/search.js index 28767996b..1c4d447f1 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -1,7 +1,6 @@ $(function() { var SearchView = Backbone.View.extend({ events: { - "keyup #search-input": "search", "click #search-clear": "clear" }, @@ -15,6 +14,7 @@ $(function() { this.$searchInputClear = this.$("#search-clear"); this.$iconsSection = this.$("#icons"); + this.$searchInput.on("keyup", _.debounce(_.bind(this.search, this), 200)); this.algoliaHelper.on("result", _.bind(this.showResults, this)); },