Chris@0: /** Chris@0: * DO NOT EDIT THIS FILE. Chris@0: * See the following change record for more information, Chris@0: * https://www.drupal.org/node/2815083 Chris@0: * @preserve Chris@0: **/ Chris@0: Chris@0: (function (Drupal, Backbone, Modernizr) { Chris@0: Drupal.contextual.RegionView = Backbone.View.extend({ Chris@0: events: function events() { Chris@0: var mapping = { Chris@0: mouseenter: function mouseenter() { Chris@0: this.model.set('regionIsHovered', true); Chris@0: }, Chris@0: mouseleave: function mouseleave() { Chris@0: this.model.close().blur().set('regionIsHovered', false); Chris@0: } Chris@0: }; Chris@0: Chris@0: if (Modernizr.touchevents) { Chris@0: mapping = {}; Chris@0: } Chris@0: return mapping; Chris@0: }, Chris@0: initialize: function initialize() { Chris@0: this.listenTo(this.model, 'change:hasFocus', this.render); Chris@0: }, Chris@0: render: function render() { Chris@0: this.$el.toggleClass('focus', this.model.get('hasFocus')); Chris@0: Chris@0: return this; Chris@0: } Chris@0: }); Chris@0: })(Drupal, Backbone, Modernizr);