@@ -378,15 +378,20 @@ If the user is in mobile definition, the modal will open in full screen:
378378### Add a button in the action bar
379379
380380` ` ` ts
381- WA .ui .actionBar .addButton (id : string , label : string , clickCallback : (buttonActionBar : AddButtonActionBar ) => void ): void
381+ WA .ui .actionBar .addButton (descriptor : {
382+ id: string ,
383+ label: string ,
384+ clickCallback : (buttonActionBar : AddButtonActionBar ) => void
385+ }): void
382386` ` `
387+
383388- id: the id of the button action bar defined.
384- - label: the label to display in button action bar .
385- - clickCallback: the callback when user click on the button. The callback have ` AddButtonActionBar ` class in parameter.
389+ - label: the label to display in the button .
390+ - clickCallback: function called when the user clicks on the button. The callback is passed a ` AddButtonActionBar ` instance in parameter.
386391
387- The ` ButtonActionBar ` is defined:
392+ With ` AddButtonActionBar ` defined as :
388393` ` ` ts
389- interface AddButtonActionBar {
394+ interface AddButtonActionBar {
390395 /*
391396 * the id of the button action bar defined.
392397 */
@@ -403,15 +408,19 @@ interface AddButtonActionBar{
403408` ` ` ts
404409 WA .ui .actionBar .removeButton (id : string );
405410` ` `
406- - id: the id of the button action bar previously defined.
411+ - id: the id of the action bar button previously defined.
407412
408- ### Example of action bar button
413+ ### Example of an action bar button
409414` ` ` ts
410415 // Add action bar button 'Register'.
411- WA .ui .actionBar .addButton (' register-btn' , ' Regsiter' , (event ) => {
412- console .log (' Button registered triggered' , event );
413- // When user click on the action bar button 'Register', we remove it.
414- WA .ui .actionBar .removeButton (' register-btn' );
416+ WA .ui .actionBar .addButton ({
417+ id: ' register-btn' ,
418+ label: ' Register' ,
419+ callback : (event ) => {
420+ console .log (' Button clicked' , event );
421+ // When a user clicks on the action bar button 'Register', we remove it.
422+ WA .ui .actionBar .removeButton (' register-btn' );
423+ }
415424 });
416425` ` `
417426
0 commit comments