OLD | NEW |
1 "use strict"; | 1 "use strict"; |
2 /* | 2 /* |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 cell.setSelected(this.selectedRow === row); | 2431 cell.setSelected(this.selectedRow === row); |
2432 for (var i = 0; i < cell.monthButtons.length; ++i) { | 2432 for (var i = 0; i < cell.monthButtons.length; ++i) { |
2433 var month = new Month(row + 1, i); | 2433 var month = new Month(row + 1, i); |
2434 cell.monthButtons[i].id = month.toString(); | 2434 cell.monthButtons[i].id = month.toString(); |
2435 cell.monthButtons[i].setAttribute("aria-disabled", this._minimumMonth >
month || this._maximumMonth < month ? "true" : "false"); | 2435 cell.monthButtons[i].setAttribute("aria-disabled", this._minimumMonth >
month || this._maximumMonth < month ? "true" : "false"); |
2436 cell.monthButtons[i].setAttribute("aria-label", month.toLocaleString()); | 2436 cell.monthButtons[i].setAttribute("aria-label", month.toLocaleString()); |
2437 } | 2437 } |
2438 if (this.highlightedMonth && row === this.highlightedMonth.year - 1) { | 2438 if (this.highlightedMonth && row === this.highlightedMonth.year - 1) { |
2439 var monthButton = cell.monthButtons[this.highlightedMonth.month]; | 2439 var monthButton = cell.monthButtons[this.highlightedMonth.month]; |
2440 monthButton.classList.add(YearListCell.ClassNameHighlighted); | 2440 monthButton.classList.add(YearListCell.ClassNameHighlighted); |
2441 // aira-activedescendant assumes both elements have layoutObjects, and | 2441 // aria-activedescendant assumes both elements have layoutObjects, and |
2442 // |monthButton| might have no layoutObject yet. | 2442 // |monthButton| might have no layoutObject yet. |
2443 var element = this.element; | 2443 var element = this.element; |
2444 setTimeout(function() { | 2444 setTimeout(function() { |
2445 element.setAttribute("aria-activedescendant", monthButton.id); | 2445 element.setAttribute("aria-activedescendant", monthButton.id); |
2446 }, 0); | 2446 }, 0); |
2447 } | 2447 } |
2448 var animator = this._runningAnimators[row]; | 2448 var animator = this._runningAnimators[row]; |
2449 if (animator) | 2449 if (animator) |
2450 cell.setHeight(animator.currentValue); | 2450 cell.setHeight(animator.currentValue); |
2451 else if (row === this.selectedRow) | 2451 else if (row === this.selectedRow) |
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4042 event.stopPropagation(); | 4042 event.stopPropagation(); |
4043 event.preventDefault(); | 4043 event.preventDefault(); |
4044 } | 4044 } |
4045 }; | 4045 }; |
4046 | 4046 |
4047 if (window.dialogArguments) { | 4047 if (window.dialogArguments) { |
4048 initialize(dialogArguments); | 4048 initialize(dialogArguments); |
4049 } else { | 4049 } else { |
4050 window.addEventListener("message", handleMessage, false); | 4050 window.addEventListener("message", handleMessage, false); |
4051 } | 4051 } |
OLD | NEW |