Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / contextual / js / views / AuralView.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function (Drupal, Backbone) {
9   Drupal.contextual.AuralView = Backbone.View.extend({
10     initialize: function initialize(options) {
11       this.options = options;
12
13       this.listenTo(this.model, 'change', this.render);
14
15       this.$el.attr('role', 'form');
16
17       this.render();
18     },
19     render: function render() {
20       var isOpen = this.model.get('isOpen');
21
22       this.$el.find('.contextual-links').prop('hidden', !isOpen);
23
24       this.$el.find('.trigger').text(Drupal.t('@action @title configuration options', {
25         '@action': !isOpen ? this.options.strings.open : this.options.strings.close,
26         '@title': this.model.get('title')
27       })).attr('aria-pressed', isOpen);
28     }
29   });
30 })(Drupal, Backbone);