Cleanup, do not allow search to take place when no keywords are provided
This commit is contained in:
parent
c5d966c6ae
commit
30b84608d3
@ -86,7 +86,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
ready: function() {
|
ready: function() {
|
||||||
$('.selectpicker').selectpicker();
|
$('#keywords').selectpicker();
|
||||||
|
|
||||||
$.getJSON('/node/keywords', function(keywords) {
|
$.getJSON('/node/keywords', function(keywords) {
|
||||||
for (var i = 0, count = keywords.length; i < count; ++i) {
|
for (var i = 0, count = keywords.length; i < count; ++i) {
|
||||||
@ -96,8 +96,11 @@
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.selectpicker').selectpicker('refresh');
|
$('#keywords').selectpicker('refresh');
|
||||||
$('#search').prop('disabled', false);
|
$('#keywords').change(function() {
|
||||||
|
$('#search').prop('disabled', $(this).val() === null);
|
||||||
|
});
|
||||||
|
|
||||||
$('#search').click(onSearch);
|
$('#search').click(onSearch);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="keywords" class="col-md-2 control-label">Keywords</label>
|
<label for="keywords" class="col-md-2 control-label">Keywords</label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<select id="keywords" class="form-control selectpicker" multiple="multiple" data-max-options="4" data-live-search="data-live-search" name="keywords"></select>
|
<select id="keywords" class="form-control" multiple="multiple" data-max-options="4" data-live-search="data-live-search" name="keywords"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
Loading…
Reference in New Issue
Block a user