-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: checkbox to enable options if product is a course (#42)
* feat: checkbox to enable options if product is a course * feat: option to set open edx course product type to a product * refactor: added end line to js and css files
- Loading branch information
1 parent
6ae1ead
commit 5fe899b
Showing
4 changed files
with
82 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,3 +121,7 @@ | |
#namediv #openedx_enrollment_order_id { | ||
width: 200px; | ||
} | ||
|
||
.custom_options_group{ | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
document.addEventListener('DOMContentLoaded', function() { | ||
var checkbox = document.getElementById("is_openedx_course"); | ||
handleCheckboxChange(checkbox); | ||
}); | ||
|
||
document.addEventListener('change', function() { | ||
var checkbox = document.getElementById("is_openedx_course"); | ||
handleCheckboxChange(checkbox); | ||
}); | ||
|
||
function handleCheckboxChange(checkbox) { | ||
var optionsGroup = document.querySelector('.custom_options_group'); | ||
if (checkbox.checked) { | ||
optionsGroup.style.display = 'unset'; | ||
} else { | ||
optionsGroup.style.display = 'none'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters