Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: Add _isEnabled option (fixes #18) #19

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ The following attributes, set within *course.json*, configure the defaults for *

The `_toc` object contains the following settings:

#### **\_isEnabled** (boolean)

Turns on and off the **ToC** extension.

#### **\_drawerPosition** (string)

The position that the button appears in the drawer. Position options include `auto`, `left`, and `right`. Defaults to `auto`
Expand Down
1 change: 1 addition & 0 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

// custom structure: specify a hierarchy by defining groups of content objects
"_toc": {
"_isEnabled": true,
"_drawerPosition": "auto",
"_grouping": {
"_classes": "",
Expand Down
3 changes: 3 additions & 0 deletions js/tocNavigationView.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ define([
},

initialize: function() {
var cfg = Adapt.course.get('_toc') || {};
if (!cfg || cfg._isEnabled === false) return;

this.$el.attr('role', 'button');
this.ariaText = '';

Expand Down
7 changes: 7 additions & 0 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
"type": "object",
"legend": "TOC",
"properties": {
"_isEnabled": {
"type": "boolean",
"default": true,
"title": "Enable TOC",
"inputType": "Checkbox",
"validators": []
},
"_drawerPosition": {
"type": "string",
"required": true,
Expand Down
Loading