1

Custom formatter for slider

This commit is contained in:
Alex Yatskov 2014-10-15 16:36:56 +09:00
parent 0ae92d1957
commit bf87baa41a

View File

@ -179,7 +179,17 @@
ready: function() {
$('#keywordsToSearch').selectpicker();
$('#history').slider();
$('#history').slider({
formatter: function(value) {
var delta = log.length - (value + 1);
switch (delta) {
case 0:
return 'Most recent query';
case 1:
return String(delta) + ' querie(s) back';
}
}
});
$.getJSON('/get_keywords', function(keywords) {
$('#searchKeywords').click(onSearch);