Skip to content
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
2 changes: 1 addition & 1 deletion example.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"_close": {
"_navOrder": 110,
"navLabel": "Close",
"ariaLabel": "Select here to close the course.",
"_navTooltip": {
"_isEnabled": true,
"text": "Close"
Expand All @@ -16,7 +17,6 @@
"_button": {
"_isEnabled": true,
"_closeViaLMSFinish": false,
"navigationAriaLabel": "Close course button",
"_notifyPromptIfIncomplete": {
"_isEnabled": false,
"title": "Confirm close",
Expand Down
10 changes: 2 additions & 8 deletions js/CloseNavigationButtonView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ import tooltips from 'core/js/tooltips';
import notify from 'core/js/notify';

export default class CloseNavigationButtonView extends NavigationButtonView {

attributes() {
const attributes = this.model.toJSON();
return {
name: attributes._id,
role: attributes._role === 'button' ? undefined : attributes._role,
'aria-label': Adapt.adaptclose.config._button.navigationAriaLabel,
'data-order': attributes._order,
'data-tooltip-id': 'adaptclose',
'data-event': 'closeButton'
...super.attributes(),
'data-tooltip-id': 'adaptclose'
};
}

Expand Down
6 changes: 4 additions & 2 deletions js/adapt-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class AdaptClose extends Backbone.Controller {
this.listenToOnce(Adapt, 'adapt:start', this.onStart);
}


get config () {
return Adapt.course.get('_close');
}
Expand Down Expand Up @@ -49,7 +48,8 @@ class AdaptClose extends Backbone.Controller {
const {
_navOrder = 100,
_showLabel = true,
navLabel = ''
navLabel = '',
ariaLabel = ''
} = AdaptClose.globalsConfig ?? {};

const model = new NavigationButtonModel({
Expand All @@ -59,7 +59,9 @@ class AdaptClose extends Backbone.Controller {
_classes: 'btn-icon nav__btn nav__close-btn',
_iconClasses: '',
_role: 'button',
ariaLabel,
text: navLabel,
_event: 'closeButton',
config: this.config
});

Expand Down
12 changes: 2 additions & 10 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"$schema": "http://json-schema.org/draft-03/schema",
"id": "http://jsonschema.net",
"globals": {
"closeButton": {
"ariaLabel": {
"type": "string",
"default": "Select here to close the window.",
"default": "Select here to close the course.",
"title": "Close button ARIA label",
"inputType": "Text",
"translatable": true
Expand Down Expand Up @@ -85,14 +85,6 @@
"inputType": "Checkbox",
"help": "Enables closing the course via the SCORM 'finish' function rather than by closing the window - useful for LMSes that don't open the course in a new window or don't allow the course window to be closed via JavaScript."
},
"navigationAriaLabel": {
"type": "string",
"default": "Close course button",
"title": "Navigation button alt text",
"inputType": "Text",
"required": true,
"translatable": true
},
"_notifyPromptIfIncomplete": {
"type": "object",
"title": "Notify prompt if incomplete",
Expand Down
12 changes: 2 additions & 10 deletions schema/course.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"title": "Close",
"default": {},
"properties": {
"closeButton": {
"ariaLabel": {
"type": "string",
"title": "Close button ARIA label",
"default": "Select here to close the window.",
"default": "Select here to close the course.",
"_adapt": {
"translatable": true
}
Expand Down Expand Up @@ -95,14 +95,6 @@
"description": "Enables closing the course via the SCORM 'finish' function rather than by closing the window - useful for LMSes that don't open the course in a new window or don't allow the course window to be closed via JavaScript.",
"default": false
},
"navigationAriaLabel": {
"type": "string",
"title": "Navigation button alt text",
"default": "Close course button",
"_adapt": {
"translatable": true
}
},
"_notifyPromptIfIncomplete": {
"type": "object",
"title": "Notify prompt if incomplete",
Expand Down