annotate core/modules/contextual/js/views/RegionView.js @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 /**
Chris@0 2 * DO NOT EDIT THIS FILE.
Chris@0 3 * See the following change record for more information,
Chris@0 4 * https://www.drupal.org/node/2815083
Chris@0 5 * @preserve
Chris@0 6 **/
Chris@0 7
Chris@0 8 (function (Drupal, Backbone, Modernizr) {
Chris@0 9 Drupal.contextual.RegionView = Backbone.View.extend({
Chris@0 10 events: function events() {
Chris@0 11 var mapping = {
Chris@0 12 mouseenter: function mouseenter() {
Chris@0 13 this.model.set('regionIsHovered', true);
Chris@0 14 },
Chris@0 15 mouseleave: function mouseleave() {
Chris@0 16 this.model.close().blur().set('regionIsHovered', false);
Chris@0 17 }
Chris@0 18 };
Chris@0 19
Chris@0 20 if (Modernizr.touchevents) {
Chris@0 21 mapping = {};
Chris@0 22 }
Chris@0 23 return mapping;
Chris@0 24 },
Chris@0 25 initialize: function initialize() {
Chris@0 26 this.listenTo(this.model, 'change:hasFocus', this.render);
Chris@0 27 },
Chris@0 28 render: function render() {
Chris@0 29 this.$el.toggleClass('focus', this.model.get('hasFocus'));
Chris@0 30
Chris@0 31 return this;
Chris@0 32 }
Chris@0 33 });
Chris@0 34 })(Drupal, Backbone, Modernizr);