Put location picker trigger in dedicated js file
This commit is contained in:
15
assets/js/admin-locationpicker.js
Normal file
15
assets/js/admin-locationpicker.js
Normal file
@@ -0,0 +1,15 @@
|
||||
jQuery(document).ready(function($){
|
||||
$(".sp-location-picker").locationpicker({
|
||||
location: {
|
||||
latitude: Number($(".sp-latitude").val()),
|
||||
longitude: Number($(".sp-longitude").val())
|
||||
},
|
||||
radius: 0,
|
||||
inputBinding: {
|
||||
latitudeInput: $(".sp-latitude"),
|
||||
longitudeInput: $(".sp-longitude"),
|
||||
locationNameInput: $(".sp-address")
|
||||
},
|
||||
enableAutocomplete: true
|
||||
});
|
||||
});
|
||||
@@ -168,19 +168,4 @@ jQuery(document).ready(function($){
|
||||
return event.keyCode != 13;
|
||||
});
|
||||
|
||||
// Location picker
|
||||
$(".sp-location-picker").locationpicker({
|
||||
location: {
|
||||
latitude: Number($(".sp-latitude").val()),
|
||||
longitude: Number($(".sp-longitude").val())
|
||||
},
|
||||
radius: 0,
|
||||
inputBinding: {
|
||||
latitudeInput: $(".sp-latitude"),
|
||||
longitudeInput: $(".sp-longitude"),
|
||||
locationNameInput: $(".sp-address")
|
||||
},
|
||||
enableAutocomplete: true
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user