diff --git a/dist/leaflet.distortableimage.js b/dist/leaflet.distortableimage.js index 34a01753a..453860381 100644 --- a/dist/leaflet.distortableimage.js +++ b/dist/leaflet.distortableimage.js @@ -2462,12 +2462,17 @@ L.EditAction = L.Toolbar2.Action.extend({ this._link.innerHTML = iconOptions.html; } - this._link.setAttribute('href', '#'); + this._link.setAttribute('href', '#'); // this._link.setAttribute('title', iconOptions.tooltip); - this._link.setAttribute('title', iconOptions.tooltip); this._link.setAttribute('role', 'button'); + this._link.setAttribute('data-bs-toggle', 'tooltip'); + + this._link.setAttribute('data-bs-placement', 'top'); + + this._link.setAttribute('data-bs-title', iconOptions.tooltip); + L.DomUtil.addClass(this._link, this.constructor.baseClass); if (className) { diff --git a/examples/index.html b/examples/index.html index 86e592b46..bf0300aa9 100644 --- a/examples/index.html +++ b/examples/index.html @@ -10,6 +10,7 @@ + @@ -17,6 +18,8 @@ + +
diff --git a/examples/js/index.js b/examples/js/index.js index bfea75aec..dee46a9c4 100644 --- a/examples/js/index.js +++ b/examples/js/index.js @@ -1,3 +1,5 @@ +const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="top"]') +const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) let map; (function() { diff --git a/src/edit/actions/EditAction.js b/src/edit/actions/EditAction.js index 963f2524f..d2fc5c842 100644 --- a/src/edit/actions/EditAction.js +++ b/src/edit/actions/EditAction.js @@ -39,8 +39,11 @@ L.EditAction = L.Toolbar2.Action.extend({ } this._link.setAttribute('href', '#'); - this._link.setAttribute('title', iconOptions.tooltip); + // this._link.setAttribute('title', iconOptions.tooltip); this._link.setAttribute('role', 'button'); + this._link.setAttribute('data-bs-toggle', 'tooltip'); + this._link.setAttribute('data-bs-placement', 'top'); + this._link.setAttribute('data-bs-title', iconOptions.tooltip); L.DomUtil.addClass(this._link, this.constructor.baseClass);