2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
8 (function (Backbone, Drupal) {
9 Drupal.toolbar.ToolbarAuralView = Backbone.View.extend({
10 initialize: function initialize(options) {
11 this.strings = options.strings;
13 this.listenTo(this.model, 'change:orientation', this.onOrientationChange);
14 this.listenTo(this.model, 'change:activeTray', this.onActiveTrayChange);
16 onOrientationChange: function onOrientationChange(model, orientation) {
17 Drupal.announce(Drupal.t('Tray orientation changed to @orientation.', {
18 '@orientation': orientation
21 onActiveTrayChange: function onActiveTrayChange(model, tray) {
22 var relevantTray = tray === null ? model.previous('activeTray') : tray;
27 var action = tray === null ? Drupal.t('closed') : Drupal.t('opened');
28 var trayNameElement = relevantTray.querySelector('.toolbar-tray-name');
30 if (trayNameElement !== null) {
31 text = Drupal.t('Tray "@tray" @action.', {
32 '@tray': trayNameElement.textContent,
36 text = Drupal.t('Tray @action.', { '@action': action });
38 Drupal.announce(text);