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 ($, Backbone, Drupal) { Chris@0: Drupal.quickedit.ContextualLinkView = Backbone.View.extend({ Chris@0: events: function events() { Chris@0: function touchEndToClick(event) { Chris@0: event.preventDefault(); Chris@0: event.target.click(); Chris@0: } Chris@0: Chris@0: return { Chris@0: 'click a': function clickA(event) { Chris@0: event.preventDefault(); Chris@0: this.model.set('state', 'launching'); Chris@0: }, Chris@0: 'touchEnd a': touchEndToClick Chris@0: }; Chris@0: }, Chris@0: initialize: function initialize(options) { Chris@0: this.$el.find('a').text(options.strings.quickEdit); Chris@0: Chris@0: this.render(); Chris@0: Chris@0: this.listenTo(this.model, 'change:isActive', this.render); Chris@0: }, Chris@0: render: function render(entityModel, isActive) { Chris@0: this.$el.find('a').attr('aria-pressed', isActive); Chris@0: Chris@0: this.$el.closest('.contextual').toggle(!isActive); Chris@0: Chris@0: return this; Chris@0: } Chris@0: }); Chris@0: })(jQuery, Backbone, Drupal);