X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontextual%2Fjs%2Fviews%2FKeyboardView.js;h=af8960ed97c0af2abd9443c48de8bee2a4bfb427;hb=refs%2Fheads%2Ft2;hp=9c247730e312ea3f8fce213b0dda62d9d1a6418d;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/contextual/js/views/KeyboardView.js b/web/core/modules/contextual/js/views/KeyboardView.js index 9c247730e..af8960ed9 100644 --- a/web/core/modules/contextual/js/views/KeyboardView.js +++ b/web/core/modules/contextual/js/views/KeyboardView.js @@ -1,24 +1,19 @@ /** - * @file - * A Backbone View that provides keyboard interaction for a contextual link. - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ (function (Drupal, Backbone) { - - 'use strict'; - - Drupal.contextual.KeyboardView = Backbone.View.extend(/** @lends Drupal.contextual.KeyboardView# */{ - - /** - * @type {object} - */ + Drupal.contextual.KeyboardView = Backbone.View.extend({ events: { '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 - // contextual links without the menu dismissing. + 'blur .trigger': function blurTrigger() { + this.model.blur(); + }, + 'blur .contextual-links a': function blurContextualLinksA() { var that = this; this.timer = window.setTimeout(function () { that.model.close().blur(); @@ -26,36 +21,12 @@ } }, - /** - * Provides keyboard interaction for a contextual link. - * - * @constructs - * - * @augments Backbone.View - */ - initialize: function () { - - /** - * The timer is used to create a delay before dismissing the contextual - * links on blur. This is only necessary when keyboard users tab into - * contextual links without edit mode (i.e. without TabbingManager). - * That means that if we decide to disable tabbing of contextual links - * without edit mode, all this timer logic can go away. - * - * @type {NaN|number} - */ + initialize: function initialize() { 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. + focus: function focus() { window.clearTimeout(this.timer); this.model.focus(); } - }); - -})(Drupal, Backbone); +})(Drupal, Backbone); \ No newline at end of file