mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-30 12:03:44 +01:00
Move attribution handling to seperate file.
This commit is contained in:
19
assets/maps/src/Mixin.Attribution.js
Normal file
19
assets/maps/src/Mixin.Attribution.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Attribution handling.
|
||||
*/
|
||||
L.Control.Attribution.addInitHook(function() {
|
||||
this.options.prefix += L.Contao.ATTRIBUTION;
|
||||
});
|
||||
|
||||
L.Control.Attribution.include({
|
||||
setPrefix: function (prefix) {
|
||||
if (prefix.indexOf(L.Contao.ATTRIBUTION) === -1) {
|
||||
prefix += L.Contao.ATTRIBUTION;
|
||||
}
|
||||
|
||||
this.options.prefix = prefix;
|
||||
|
||||
this._update();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user