| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @fileoverview 'user-manager-dialog' is a modal dialog for the user manager. | |
| 7 */ | |
| 8 Polymer({ | |
| 9 is: 'user-manager-dialog', | |
| 10 | |
| 11 behaviors: [Polymer.PaperDialogBehavior], | |
| 12 | |
| 13 properties: { | |
| 14 /** @override */ | |
| 15 noCancelOnOutsideClick: {type: Boolean, value: true}, | |
| 16 | |
| 17 /** @override */ | |
| 18 withBackdrop: {type: Boolean, value: true}, | |
| 19 | |
| 20 /** | |
| 21 * The first node that can receive focus. | |
| 22 * @type {!Node} | |
| 23 */ | |
| 24 firstFocusableNode: { | |
| 25 type: Object, | |
| 26 value: function() { | |
| 27 return this.$.close; | |
| 28 }, | |
| 29 observer: 'firstFocusableNodeChanged_' | |
| 30 }, | |
| 31 | |
| 32 /** | |
| 33 * The last node that can receive focus. | |
| 34 * @type {!Node} | |
| 35 */ | |
| 36 lastFocusableNode: { | |
| 37 type: Object, | |
| 38 value: function() { | |
| 39 return this.$.close; | |
| 40 }, | |
| 41 observer: 'lastFocusableNodeChanged_' | |
| 42 } | |
| 43 }, | |
| 44 | |
| 45 /** | |
| 46 * Returns the first and the last focusable elements in order to wrap the | |
| 47 * focus for the dialog in Polymer.PaperDialogBehavior. | |
| 48 * @override | |
| 49 * @type {!Array<!Node>} | |
| 50 */ | |
| 51 get _focusableNodes() { | |
| 52 return [this.firstFocusableNode, this.lastFocusableNode]; | |
| 53 }, | |
| 54 | |
| 55 /** | |
| 56 * Observer for firstFocusableNode. Updates __firstFocusableNode in | |
| 57 * Polymer.PaperDialogBehavior. | |
| 58 */ | |
| 59 firstFocusableNodeChanged_: function(newValue) { | |
| 60 this.__firstFocusableNode = newValue; | |
| 61 }, | |
| 62 | |
| 63 /** | |
| 64 * Observer for lastFocusableNodeChanged_. Updates __lastFocusableNode in | |
| 65 * Polymer.PaperDialogBehavior. | |
| 66 */ | |
| 67 lastFocusableNodeChanged_: function(newValue) { | |
| 68 this.__lastFocusableNode = newValue; | |
| 69 } | |
| 70 }); | |
| OLD | NEW |