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) { Chris@0: Drupal.contextual.AuralView = Backbone.View.extend({ Chris@0: initialize: function initialize(options) { Chris@0: this.options = options; Chris@0: Chris@0: this.listenTo(this.model, 'change', this.render); Chris@0: Chris@0: this.$el.attr('role', 'form'); Chris@0: Chris@0: this.render(); Chris@0: }, Chris@0: render: function render() { Chris@0: var isOpen = this.model.get('isOpen'); Chris@0: Chris@0: this.$el.find('.contextual-links').prop('hidden', !isOpen); Chris@0: Chris@0: this.$el.find('.trigger').text(Drupal.t('@action @title configuration options', { Chris@0: '@action': !isOpen ? this.options.strings.open : this.options.strings.close, Chris@0: '@title': this.model.get('title') Chris@0: })).attr('aria-pressed', isOpen); Chris@0: } Chris@0: }); Chris@0: })(Drupal, Backbone);