'
+ '
'
}
);
container.on('shown.bs.sabaipopover', function(){
if (slid) return;
var label = container.find('.sabai-directory-search-radius-label strong').text(radius.val());
container.find('.sabai-directory-search-radius-slider').slider({animate: true, min: 0, max: 100, value: radius.val(), step: 1, slide: function(e, ui){
radius.val(ui.value);
label.text(ui.value);
}});
if (navigator.geolocation
&& (document.location.protocol === 'https:' || document.location.hostname === 'localhost')
) {
var geocode = function (trigger) {
if (trigger) SABAI.ajaxLoader(trigger);
if (!geocoder) geocoder = new google.maps.Geocoder();
navigator.geolocation.getCurrentPosition(
function (pos) {
geocoder.geocode({'latLng': new google.maps.LatLng(pos.coords.latitude,pos.coords.longitude)}, function(results, status) {
if (trigger) SABAI.ajaxLoader(trigger, true);
if (status == google.maps.GeocoderStatus.OK) {
location.val(results[0].formatted_address).typeahead('val', results[0].formatted_address).effect('highlight', {}, 2000);
$('#sabai-embed-wordpress-shortcode-1 .sabai-directory-search-location')
.find('input[name="center"]').val(results[0].geometry.location.lat() + ',' + results[0].geometry.location.lng()).end()
.find('input[name="address_type"]').val('');
}
});
},
function (error) {
if (trigger) {
SABAI.ajaxLoader(trigger, true);
}
SABAI.flash(error.message, 'danger');
SABAI.console.log(error.message + ' (' + error.code + ')');
},
{enableHighAccuracy:true, timeout:5000}
);
};
container.find('.sabai-directory-search-geolocate').show().click(function(e){
e.preventDefault();
geocode($(this));
});
}
slid = true;
});
});
$('#sabai-embed-wordpress-shortcode-1 .sabai-directory-search-submit .sabai-btn').click(function(e){
var $this = $(this),
form = $this.closest('form');
e.preventDefault();
form.find('[placeholder]').each(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
});
var submit = function(){
SABAI.ajax({
type: 'get',
container: '#sabai-embed-wordpress-shortcode-1',
target: '.sabai-directory-listings-container',
url: form.attr('action') + '&' + form.serialize(),
pushState: true
});
};
var center = $('#sabai-embed-wordpress-shortcode-1 .sabai-directory-search-location input[name="center"]');
if (location.val()
&& $('#sabai-embed-wordpress-shortcode-1 .sabai-directory-search-location input[name="address_type"]').val() === ''
) {
if (!geocoder) geocoder = new google.maps.Geocoder();
geocoder.geocode({address: location.val(), region: 'ch'}, function(results, status) {
switch (status) {
case google.maps.GeocoderStatus.OK:
center.val(results[0].geometry.location.lat() + ',' + results[0].geometry.location.lng());
submit();
break;
case google.maps.GeocoderStatus.ZERO_RESULTS:
alert('Invalid location');
break;
default:
alert(status);
}
});
} else {
center.val('');
submit();
}
});
});
Oberdorfstrasse 14, 3662 Seftigen, Schweiz
Hübeli, 3614 Unterlangenegg, Schweiz
Hirschhorn 301, 3153 Rüschegg Gambach
Scheidbach, 6197 Schangnau, Schweiz
Alte Adelbodenstrasse 13, 3725 Achseten
Allmei 5A, 3930 Visp, Schweiz
Löhrstrasse 16, 3268 Lobsigen
Moosstrasse 44, 2540 Grenchen, Schweiz
Länggasse 23, 3326 Krauchthal, Schweiz
Gastererweg 1, IT-39054 Unterinn am Ritten
Bahnhofplatz 11, 8908 Hedingen
Leimistrasse 619, 3077 Enggistein
Hauptstrasse 92A, 3806 Bönigen, Schweiz
Brunnihaus, 3818 Grindelwald
Bernstrasse 247 3627 Heimberg
Quellenweg 5, 3303 Jegenstorf
Bunschen, 3765 Oberwil im Simmental, Schweiz
Kantonsstrasse 16, 3942 Raron, Schweiz
Schwandistrasse 29, 3714 Frutigen, Schweiz
Alte Landstrasse 41, 3900 Gamsen
Bielstrasse 13, 3232 Ins, Schweiz
Eichenweg 4, 3052 Zollikofen, Schweiz
Lenkstrasse 96, 3775 Lenk im Simmental, Schweiz
Dorfstrasse 1, Oberwald, 3999, Schweiz
Kreuzweg 117C, 3614 Unterlangenegg, Schweiz
Lenggasse 10, 3860 Meiringen, Schweiz
Untere Dorfstrasse 25, 3906 Saas-Fee, Schweiz
Stegmattstrasse 4, 3457 Wasen i. E.
Freiburgstrasse 6, 3178 Bösingen, Schweiz