1

Enable basic keyword validation

This commit is contained in:
Alex Yatskov 2014-09-18 17:47:57 +09:00
parent ba8f1b3c99
commit c5ac0eb8d5
2 changed files with 7 additions and 2 deletions

View File

@ -115,10 +115,15 @@
} }
$('#search').click(onSearch); $('#search').click(onSearch);
$('#learn').click(onLearn); $('#learn').click(onLearn);
$('#keyword').bind('input', function() {
$('#learn').prop('disabled', !$(this).val());
});
$('#keywords').selectpicker('refresh'); $('#keywords').selectpicker('refresh');
$('#keywords').change(function() { $('#keywords').change(function() {
$('#search').prop('disabled', $(this).val() === null); $('#search').prop('disabled', !$(this).val());
}); });
}); });
} }

View File

@ -91,7 +91,7 @@
<div class="modal-footer"> <div class="modal-footer">
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="learn">Learn</button> <button type="button" class="btn btn-primary" id="learn" disabled="disabled">Learn</button>
</div> </div>
</div> </div>
</div> </div>