|
117 | 117 | /** @final {HTMLElement} */
|
118 | 118 | this.calendarElement = $element[0].querySelector('.md-calendar');
|
119 | 119 |
|
120 |
| - /** @final {HTMLElement} */ |
121 |
| - this.ariaLiveElement = $element[0].querySelector('[aria-live]'); |
122 |
| - |
123 |
| - // TODO(jelbourn): one global live region. |
124 |
| - //this.ariaLiveElement.parentNode.removeChild(this.ariaLiveElement); |
125 |
| - //document.body.appendChild(this.ariaLiveElement); |
126 |
| - |
127 | 120 | /** @final {HTMLElement} */
|
128 | 121 | this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller');
|
129 | 122 |
|
|
373 | 366 | CalendarCtrl.prototype.focus = function(opt_date) {
|
374 | 367 | var date = opt_date || this.selectedDate;
|
375 | 368 |
|
376 |
| - if (!opt_date) { |
377 |
| - this.announceDisplayDateChange(null, date); |
378 |
| - } |
379 |
| - |
380 | 369 | var previousFocus = this.calendarElement.querySelector('.md-focus');
|
381 | 370 | if (previousFocus) {
|
382 | 371 | previousFocus.classList.remove('md-focus');
|
383 |
| - //previousFocus.setAttribute('aria-selected', 'false'); |
384 | 372 | }
|
385 | 373 |
|
386 |
| - |
387 | 374 | var cellId = this.getDateId(date);
|
388 | 375 | var cell = this.calendarElement.querySelector('#' + cellId);
|
389 | 376 | if (cell) {
|
390 | 377 | cell.classList.add('md-focus');
|
391 | 378 | cell.focus();
|
392 |
| - //this.calendarElement.setAttribute('aria-activedescendant', cell.id); |
393 |
| - //cell.setAttribute('aria-selected', 'true'); |
394 | 379 | } else {
|
395 | 380 | this.focusDate = date;
|
396 | 381 | }
|
397 |
| - |
398 |
| - //this.calendarElement.focus(); |
399 |
| - |
400 |
| - //this.$element[0].querySelector('.md-dummy').focus(); |
401 |
| - //this.calendarElement.focus(); |
402 | 382 | };
|
403 | 383 |
|
404 | 384 | /*** Updating the displayed / selected date ***/
|
|
461 | 441 | this.isMonthTransitionInProgress = true;
|
462 | 442 | var animationPromise = this.animateDateChange(date);
|
463 | 443 |
|
464 |
| - this.announceDisplayDateChange(this.displayDate, date); |
465 | 444 | this.displayDate = date;
|
466 | 445 |
|
467 | 446 | var self = this;
|
|
482 | 461 | return this.$q.when();
|
483 | 462 | };
|
484 | 463 |
|
485 |
| - /** |
486 |
| - * Announces a change in date to the calendar's aria-live region. |
487 |
| - * @param {Date} previousDate |
488 |
| - * @param {Date} currentDate |
489 |
| - */ |
490 |
| - CalendarCtrl.prototype.announceDisplayDateChange = function(previousDate, currentDate) { |
491 |
| - return; |
492 |
| - |
493 |
| - // If the date has not changed at all, do nothing. |
494 |
| - if (previousDate && this.dateUtil.isSameDay(previousDate, currentDate)) { |
495 |
| - return; |
496 |
| - } |
497 |
| - |
498 |
| - // If the date has changed to another date within the same month and year, make a short |
499 |
| - // announcement. |
500 |
| - if (previousDate && this.dateUtil.isSameMonthAndYear(previousDate, currentDate)) { |
501 |
| - this.ariaLiveElement.textContent = this.dateLocale.shortAnnounceFormatter(currentDate); |
502 |
| - return; |
503 |
| - } |
504 |
| - |
505 |
| - // If the date has changed to another date in a different month and/or year, make a long |
506 |
| - // announcement. |
507 |
| - if (!previousDate || !this.dateUtil.isSameDay(previousDate, currentDate)) { |
508 |
| - this.ariaLiveElement.textContent = this.dateLocale.longAnnounceFormatter(currentDate); |
509 |
| - } |
510 |
| - }; |
511 |
| - |
512 |
| - |
513 | 464 | /*** Constructing the calendar table ***/
|
514 | 465 |
|
515 | 466 | /**
|
|
0 commit comments