From 802eb628c81ef9a5fa7af6523bb0c053fbffda24 Mon Sep 17 00:00:00 2001 From: Jonathan Rehm Date: Mon, 10 Jul 2017 13:03:58 -0700 Subject: [PATCH] Split event listener and selector string Event and selectors appear to have been accidentally combined. The result is that typing in any input triggers a call to the `/get_matching_tags` route. We can probably limit the selector farther to only fire when `#tags` is typed into. --- cps/static/js/edit_books.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index 8a1a36d1..f8d61e4e 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -162,7 +162,7 @@ var promiseLanguages = languages.initialize(); }); }); -$("form").on("change input typeahead:selected", function(data){ +$("form").on("change", "input.typeahead:selected", function(){ var form = $("form").serialize(); $.getJSON( getPath()+"/get_matching_tags", form, function( data ) { $(".tags_click").each(function() {