Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit ac21154

Browse files
committed
An update to newButton() docs
1 parent 8924b75 commit ac21154

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/js/app/challenge-details/js/controllers/challenge-details-controller.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,17 @@
535535
}
536536

537537
/**
538-
* Prepare data for template
538+
* Creates a new button for user actions at the Challenge Details page.
539539
*
540-
* @param button.text required string
541-
* @param button.onClick or button.href required
542-
* @param button.classes optional
543-
* @returns new button {}
540+
* @param {String} button.classes Classes to add to the button.
541+
* @param {String} button.href URL to follow when the button is clicked.
542+
* Alternatively, the caller may provide `button.onClick` instead, but not
543+
* both.
544+
* @param {Function} button.onClick Callback to trigger when the button is
545+
* clicked. Alternatively, the caller may provide `button.href` instead, but
546+
* not both.
547+
* @param {String} button.text Button label.
548+
* @return Button object.
544549
*/
545550
function newButton(button) {
546551
if (!button.text || (!button.onClick && !button.href)) {

0 commit comments

Comments
 (0)