Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: third_party/polymer/v0_8/components-chromium/iron-a11y-announcer/iron-a11y-announcer-extracted.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1
2
3 (function() {
4 'use strict';
5
6 Polymer.IronA11yAnnouncer = Polymer({
7 is: 'iron-a11y-announcer',
8
9 properties: {
10
11 /**
12 * The value of mode is used to set the `aria-live` attribute
13 * for the element that will be announced. Valid values are: `off`,
14 * `polite` and `assertive`.
15 */
16 mode: {
17 type: String,
18 value: 'polite'
19 },
20
21 _text: {
22 type: String,
23 value: ''
24 }
25 },
26
27 created: function() {
28 if (!Polymer.IronA11yAnnouncer.instance) {
29 Polymer.IronA11yAnnouncer.instance = this;
30 }
31
32 document.body.addEventListener('iron-announce', this._onIronAnnounce.b ind(this));
33 },
34
35 /**
36 * Cause a text string to be announced by screen readers.
37 *
38 * @param {string} text The text that should be announced.
39 */
40 announce: function(text) {
41 this._text = '';
42 this.async(function() {
43 this._text = text;
44 }, 100);
45 },
46
47 _onIronAnnounce: function(event) {
48 if (event.detail && event.detail.text) {
49 this.announce(event.detail.text);
50 }
51 }
52 });
53
54 Polymer.IronA11yAnnouncer.instance = null;
55
56 Polymer.IronA11yAnnouncer.requestAvailability = function() {
57 if (!Polymer.IronA11yAnnouncer.instance) {
58 document.createElement('iron-a11y-announcer');
59 }
60
61 document.body.appendChild(Polymer.IronA11yAnnouncer.instance);
62 };
63 })();
64
65
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698