|
|
@@ -22,17 +22,30 @@ $(document).ready( function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ $('.filtered-dropdown').select2({
|
|
|
+ theme: 'bootstrap',
|
|
|
+ placeholder: 'Rechercher...',
|
|
|
+ minimumInputLength: 1,
|
|
|
+ language: {
|
|
|
+ inputTooShort: function () { return "Veuillez saisir votre recherche..."; },
|
|
|
+ errorLoading: function () { return "Erreur de chargement"; },
|
|
|
+ searching: function () { return "Recherche en cours…"; },
|
|
|
+ noResults: function () { return "Aucun résultat"; },
|
|
|
+ loadingMore: function () { return "Chargement de résultats supplémentaires…"; }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
$('#search-bar').select2({
|
|
|
+ theme: 'bootstrap',
|
|
|
placeholder: 'Rechercher...',
|
|
|
- language: "fr",
|
|
|
- minimumInputLength: 2,
|
|
|
+ minimumInputLength: 1,
|
|
|
ajax: {
|
|
|
url: '/search/',
|
|
|
dataType: 'json',
|
|
|
cache: true,
|
|
|
-// delay: 100
|
|
|
+ delay: 220
|
|
|
},
|
|
|
-// closeOnSelect: false,
|
|
|
+ closeOnSelect: false,
|
|
|
width : '220px',
|
|
|
templateResult: function (state) { return $('<a href="' + state.id + '">' + state.text + '</a>'); },
|
|
|
language: {
|
|
|
@@ -44,6 +57,11 @@ $(document).ready( function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ $('#search-bar').on('change', function() {
|
|
|
+ event.preventDefault();
|
|
|
+ window.location.href = $(this).first('option').val();
|
|
|
+ });
|
|
|
+
|
|
|
$('#stories').on('change', 'select[data-filter]', function() {
|
|
|
|
|
|
var filters = [];
|
|
|
@@ -394,6 +412,4 @@ $(document).ready( function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- $('.filtered-dropdown').select2();
|
|
|
-
|
|
|
});
|