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

Commit 861bcb7

Browse files
committed
A few small changes
1 parent ac21154 commit 861bcb7

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -549,17 +549,14 @@
549549
*/
550550
function newButton(button) {
551551
if (!button.text || (!button.onClick && !button.href)) {
552-
return false;
552+
throw new Error('Invalid arguments in the newButton() method!');
553553
}
554-
var tempButton = {};
555-
tempButton.text = button.text || '';
556-
tempButton.classes = button.classes || '';
557-
if (button.href) {
558-
tempButton.href = button.href;
559-
} else {
560-
tempButton.onClick = button.onClick;
561-
}
562-
return tempButton;
554+
var res = {};
555+
res.text = button.text || '';
556+
res.classes = button.classes || '';
557+
if (button.href) res.href = button.href;
558+
else res.onClick = button.onClick;
559+
return res;
563560
}
564561

565562
function initButtons(vm) {
@@ -595,6 +592,7 @@
595592
}));
596593
}
597594
}
595+
598596
/**
599597
* Prepares phase specific member program details. This detail is used for PEER reviewed
600598
* challenges only.

0 commit comments

Comments
 (0)