From cd41ff283aeca90e3b084d02625139362c62042e Mon Sep 17 00:00:00 2001 From: Hashim Khan Date: Thu, 23 Jul 2026 07:58:58 +0500 Subject: [PATCH] docs(toolbar): document element param instead of html The toolbar plugin accepts a DOM element via detail.element and does not fire impress:toolbar:added. Align the plugin header docs with the implementation and navigation-ui usage. Fixes #771. --- src/plugins/toolbar/toolbar.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/toolbar/toolbar.js b/src/plugins/toolbar/toolbar.js index 5e03d0994..4135b0927 100644 --- a/src/plugins/toolbar/toolbar.js +++ b/src/plugins/toolbar/toolbar.js @@ -43,14 +43,11 @@ * * { group : 1, // integer. Widgets with the same group are grouped inside * // the same element. - * html : "", // The html to add. - * callback : "mycallback", // Toolbar plugin will trigger event - * // `impress:toolbar:added:mycallback` when done. + * element : buttonElement, // The DOM element to add to the toolbar. * before: element } // The reference element for an insertBefore() call. * - * You should also listen to the `impress:toolbar:added:mycallback` event. At - * this point you can find the new widget in the DOM, and for example add an - * event listener to it. + * After the event is handled, the widget is already in the DOM, so you can + * attach event listeners to it immediately (see navigation-ui for an example). * * You are free to use any integer for the group. It's ok to leave gaps. It's * ok to co-locate with widgets for another plugin, if you think they belong