|
4 | 4 | * @example wavesurfer.addMarker(regionParams);
|
5 | 5 | * @property {number} time The time to set the marker at
|
6 | 6 | * @property {?label} string An optional marker label
|
| 7 | + * @property {?tooltip} string An optional marker tooltip |
7 | 8 | * @property {?color} string Background color for marker
|
8 | 9 | * @property {?position} string "top" or "bottom", defaults to "bottom"
|
9 | 10 | * @property {?markerElement} element An HTML element to display instead of the default marker image
|
@@ -159,6 +160,7 @@ export default class MarkersPlugin {
|
159 | 160 | let marker = {
|
160 | 161 | time: params.time,
|
161 | 162 | label: params.label,
|
| 163 | + tooltip: params.tooltip, |
162 | 164 | color: params.color || DEFAULT_FILL_COLOR,
|
163 | 165 | position: params.position || DEFAULT_POSITION,
|
164 | 166 | draggable: !!params.draggable,
|
@@ -231,6 +233,7 @@ export default class MarkersPlugin {
|
231 | 233 |
|
232 | 234 | _createMarkerElement(marker, markerElement) {
|
233 | 235 | let label = marker.label;
|
| 236 | + let tooltip = marker.tooltip; |
234 | 237 |
|
235 | 238 | const el = document.createElement('marker');
|
236 | 239 | el.className = "wavesurfer-marker";
|
@@ -265,6 +268,7 @@ export default class MarkersPlugin {
|
265 | 268 | if ( label ) {
|
266 | 269 | const labelEl = document.createElement('span');
|
267 | 270 | labelEl.innerText = label;
|
| 271 | + labelEl.setAttribute('title', tooltip); |
268 | 272 | this.style(labelEl, {
|
269 | 273 | "font-family": "monospace",
|
270 | 274 | "font-size": "90%"
|
|
0 commit comments