diff --git a/core/modules/contextual/contextual.js b/core/modules/contextual/contextual.js index 0a678e5..2c696d5 100644 --- a/core/modules/contextual/contextual.js +++ b/core/modules/contextual/contextual.js @@ -255,7 +255,7 @@ Drupal.contextual = { }), /** - * Renders the aural view of a contextual link (i.e.screen reader support). + * Renders the aural view of a contextual link (i.e. screen reader support). */ AuralView: Backbone.View.extend({ /** @@ -296,11 +296,8 @@ Drupal.contextual = { */ KeyboardView: Backbone.View.extend({ events: { - 'focus .trigger, focus .contextual-links a' : function () { - // Clear the timeout that might have been set by blurring a link. - window.clearTimeout(this.timer); - this.model.focus(); - }, + 'focus .trigger': 'focus', + 'focus .contextual-links a': 'focus', 'blur .trigger': function () { this.model.blur(); }, 'blur .contextual-links a': function () { // Set up a timeout to allow a user to tab between the trigger and the @@ -322,6 +319,15 @@ Drupal.contextual = { // That means that if we decide to disable tabbing of contextual links // without edit mode, all this timer logic can go away. this.timer = NaN; + }, + + /** + * Sets focus on the model; Clears the timer that dismisses the links. + */ + focus: function () { + // Clear the timeout that might have been set by blurring a link. + window.clearTimeout(this.timer); + this.model.focus(); } }), @@ -344,7 +350,7 @@ Drupal.contextual = { }, /** - * Implements Backbone.View.prototype.initialize(). + * {@inheritdoc} */ initialize: function () { this.model.on('change:hasFocus', this.render, this); diff --git a/core/modules/contextual/contextual.toolbar.js b/core/modules/contextual/contextual.toolbar.js index 9c3b975..3742c43 100644 --- a/core/modules/contextual/contextual.toolbar.js +++ b/core/modules/contextual/contextual.toolbar.js @@ -9,8 +9,8 @@ var options = { strings: { - tabbingReleased: Drupal.t('Tabbing is no longer constrained by the Contextual module'), - tabbingConstrained: Drupal.t('Tabbing is constrained to a set of @contextualsCount and the Edit mode toggle'), + tabbingReleased: Drupal.t('Tabbing is no longer constrained by the Contextual module.'), + tabbingConstrained: Drupal.t('Tabbing is constrained to a set of @contextualsCount and the Edit mode toggle.'), pressEsc: Drupal.t('Press the esc key to exit.'), contextualsCount: { singular: '@count contextual link',