KeyboardView.js 819 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. **/
  7. (function (Drupal, Backbone) {
  8. Drupal.contextual.KeyboardView = Backbone.View.extend({
  9. events: {
  10. 'focus .trigger': 'focus',
  11. 'focus .contextual-links a': 'focus',
  12. 'blur .trigger': function blurTrigger() {
  13. this.model.blur();
  14. },
  15. 'blur .contextual-links a': function blurContextualLinksA() {
  16. var that = this;
  17. this.timer = window.setTimeout(function () {
  18. that.model.close().blur();
  19. }, 150);
  20. }
  21. },
  22. initialize: function initialize() {
  23. this.timer = NaN;
  24. },
  25. focus: function focus() {
  26. window.clearTimeout(this.timer);
  27. this.model.focus();
  28. }
  29. });
  30. })(Drupal, Backbone);