Only initialize the various elements if they are in the dom.
This commit is contained in:
parent
d64f78dc5e
commit
509a4f501b
1 changed files with 55 additions and 48 deletions
|
@ -9,9 +9,15 @@ function addGeoCoordinates(ev) {
|
||||||
}
|
}
|
||||||
var map = null;
|
var map = null;
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
if ($('.icon.link').length > 0) {
|
||||||
$('.icon.link').popup();
|
$('.icon.link').popup();
|
||||||
jQuery('input[type=datetime]').datetimepicker({lang: 'de', format: 'Y-m-d H:i'});
|
}
|
||||||
|
|
||||||
|
if (jQuery('input[type=datetime]').length > 0) {
|
||||||
|
jQuery('input[type=datetime]').datetimepicker({lang: 'de', format: 'Y-m-d H:i'});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jQuery('#map').length == 1) {
|
||||||
$('.add_geo').click(addGeoCoordinates);
|
$('.add_geo').click(addGeoCoordinates);
|
||||||
map = L.map('map');
|
map = L.map('map');
|
||||||
|
|
||||||
|
@ -62,4 +68,5 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).modal('attach events', '.add_geo', 'show');
|
}).modal('attach events', '.add_geo', 'show');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue