From bf3725bcb8e0471135064ff0c0a0156000270a20 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 19 Sep 2014 20:15:34 +0900 Subject: [PATCH] Cleanup --- client/application.js | 22 ++++++++++----------- client/index.html | 45 +++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/client/application.js b/client/application.js index f7e0435..d616660 100644 --- a/client/application.js +++ b/client/application.js @@ -71,21 +71,19 @@ } function onLearn() { - $('#learn').prop('disabled', true); - + $('#learnKeyword').prop('disabled', true); $('#learnError').slideUp(function() { var query = { - keyword: $('#keyword').val(), + keyword: $('#keywordToLearn').val(), params: ctx.searchParams }; - $.getJSON('/node/addKeyword', query, function(results) { if (results.success) { - $('#learnDlg').modal('hide'); + $('#learnDialog').modal('hide'); } else { $('#learnError').slideDown(function() { - $('#learn').prop('disabled', false); + $('#learnKeyword').prop('disabled', false); }); } }); @@ -127,15 +125,15 @@ $('#search').click(onSearch); - $('#learnDlg').on('show.bs.modal', function() { - $('#learn').prop('disabled', true); - $('#keyword').val(''); + $('#learnDialog').on('show.bs.modal', function() { + $('#learnKeyword').prop('disabled', true); + $('#keywordToLearn').val(''); $('#learnError').hide(); }); - $('#learn').click(onLearn); - $('#keyword').bind('input', function() { - $('#learn').prop('disabled', !$(this).val()); + $('#learnKeyword').click(onLearn); + $('#keywordToLearn').bind('input', function() { + $('#learnKeyword').prop('disabled', !$(this).val()); }); $('#keywords').selectpicker('refresh'); diff --git a/client/index.html b/client/index.html index e28f28e..201723f 100644 --- a/client/index.html +++ b/client/index.html @@ -50,7 +50,7 @@ -