From 30b84608d3b09ba4fa140ab9d315483b89a1ebb5 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 15 Sep 2014 18:35:01 +0900 Subject: [PATCH] Cleanup, do not allow search to take place when no keywords are provided --- client/application.js | 9 ++++++--- client/index.html | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/application.js b/client/application.js index f3ec9d2..25e3725 100644 --- a/client/application.js +++ b/client/application.js @@ -86,7 +86,7 @@ }, ready: function() { - $('.selectpicker').selectpicker(); + $('#keywords').selectpicker(); $.getJSON('/node/keywords', function(keywords) { for (var i = 0, count = keywords.length; i < count; ++i) { @@ -96,8 +96,11 @@ })); } - $('.selectpicker').selectpicker('refresh'); - $('#search').prop('disabled', false); + $('#keywords').selectpicker('refresh'); + $('#keywords').change(function() { + $('#search').prop('disabled', $(this).val() === null); + }); + $('#search').click(onSearch); }); } diff --git a/client/index.html b/client/index.html index c4b17f0..ff7d873 100644 --- a/client/index.html +++ b/client/index.html @@ -22,7 +22,7 @@
- +