Skip to content

Commit

Permalink
Issue/1763 (#1764)
Browse files Browse the repository at this point in the history
* create label outside of #wrapper element

* add global for trickle label

* fix typo

* create the Element with jQuery

* $

* return early

* change wording
  • Loading branch information
lc-thomasberger authored and oliverfoster committed Sep 29, 2017
1 parent bd693dd commit 6d830ad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/core/js/views/pageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ define([
this.disableAnimation = Adapt.config.has('_disableAnimation') ? Adapt.config.get('_disableAnimation') : false;
this.$el.css('opacity', 0);
this.listenTo(this.model, 'change:_isReady', this.isReady);

var accessibility = Adapt.config.get('_accessibility');
if (!accessibility._isEnabled && !accessibility._isEnabledOnTouchDevices) {
return;
}
// create aria-label outside of #wrapper
this.$pageLabel = $('<div/>', {
'class': 'aria-label relative a11y-ignore-focus prevent-default',
tabindex: 0,
role: 'region',
text: Adapt.course.get('_globals')._accessibility._ariaLabels.pageEnd
}).appendTo('body');
},

isReady: function() {
Expand All @@ -40,6 +52,13 @@ define([
$(window).scroll();
}, this));
}
},

remove: function() {
if (this.$pageLabel) {
this.$pageLabel.remove();
}
AdaptView.prototype.remove.call(this);
}

}, {
Expand Down
1 change: 0 additions & 1 deletion src/core/templates/page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@
</div>

</div>
<div class="aria-label relative a11y-ignore-focus prevent-default" tabindex="0" role="region">{{_globals._accessibility._ariaLabels.pageEnd}}</div>
3 changes: 3 additions & 0 deletions src/course/en/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
},
"_resources": {
"resourcesEnd": "You have reached the end of the list of resources."
},
"_trickle": {
"incompleteContent": "There is incomplete content above. You must complete this before you can proceed through the course."
}
},
"_learnerInfo": {
Expand Down

0 comments on commit 6d830ad

Please sign in to comment.