2014-01-08 07:03:02 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* All changes should be applied to ./modules/contextual/js/views/KeyboardView.es6.js
|
|
|
|
* See the following change record for more information,
|
|
|
|
* https://www.drupal.org/node/2873849
|
|
|
|
* @preserve
|
|
|
|
**/
|
2014-01-08 07:03:02 +00:00
|
|
|
|
|
|
|
(function (Drupal, Backbone) {
|
|
|
|
|
2015-10-13 22:37:56 +00:00
|
|
|
'use strict';
|
2014-01-08 07:03:02 +00:00
|
|
|
|
2017-05-19 22:12:53 +00:00
|
|
|
Drupal.contextual.KeyboardView = Backbone.View.extend({
|
2014-01-27 21:41:32 +00:00
|
|
|
events: {
|
|
|
|
'focus .trigger': 'focus',
|
|
|
|
'focus .contextual-links a': 'focus',
|
2017-05-19 22:12:53 +00:00
|
|
|
'blur .trigger': function blurTrigger() {
|
|
|
|
this.model.blur();
|
|
|
|
},
|
|
|
|
'blur .contextual-links a': function blurContextualLinksA() {
|
2014-01-27 21:41:32 +00:00
|
|
|
var that = this;
|
|
|
|
this.timer = window.setTimeout(function () {
|
|
|
|
that.model.close().blur();
|
|
|
|
}, 150);
|
|
|
|
}
|
|
|
|
},
|
2014-01-08 07:03:02 +00:00
|
|
|
|
2017-05-19 22:12:53 +00:00
|
|
|
initialize: function initialize() {
|
2014-01-27 21:41:32 +00:00
|
|
|
this.timer = NaN;
|
|
|
|
},
|
|
|
|
|
2017-05-19 22:12:53 +00:00
|
|
|
focus: function focus() {
|
2014-01-27 21:41:32 +00:00
|
|
|
window.clearTimeout(this.timer);
|
|
|
|
this.model.focus();
|
|
|
|
}
|
2014-01-08 07:03:02 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
});
|
2017-05-19 22:12:53 +00:00
|
|
|
})(Drupal, Backbone);
|