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: { |
| 16 type: Boolean, |
| 17 value: true |
| 18 }, |
| 19 |
| 20 /** @override */ |
| 21 withBackdrop: { |
| 22 type: Boolean, |
| 23 value: true |
| 24 }, |
| 25 |
| 26 /** |
| 27 * The first node that can receive focus. |
| 28 * @type {!Node} |
| 29 */ |
| 30 firstFocusableNode: { |
| 31 type: Object, |
| 32 value: function() { return this.$.close; }, |
| 33 observer: 'firstFocusableNodeChanged_' |
| 34 }, |
| 35 |
| 36 /** |
| 37 * The last node that can receive focus. |
| 38 * @type {!Node} |
| 39 */ |
| 40 lastFocusableNode: { |
| 41 type: Object, |
| 42 value: function() { return this.$.close; }, |
| 43 observer: 'lastFocusableNodeChanged_' |
| 44 } |
| 45 }, |
| 46 |
| 47 /** |
| 48 * Returns the first and the last focusable elements in order to wrap the |
| 49 * focus for the dialog in Polymer.PaperDialogBehavior. |
| 50 * @override |
| 51 * @type {!Array<!Node>} |
| 52 */ |
| 53 get _focusableNodes() { |
| 54 return [this.firstFocusableNode, this.lastFocusableNode]; |
| 55 }, |
| 56 |
| 57 /** |
| 58 * Observer for firstFocusableNode. Updates __firstFocusableNode in |
| 59 * Polymer.PaperDialogBehavior. |
| 60 */ |
| 61 firstFocusableNodeChanged_: function(newValue) { |
| 62 this.__firstFocusableNode = newValue; |
| 63 }, |
| 64 |
| 65 /** |
| 66 * Observer for lastFocusableNodeChanged_. Updates __lastFocusableNode in |
| 67 * Polymer.PaperDialogBehavior. |
| 68 */ |
| 69 lastFocusableNodeChanged_: function(newValue) { |
| 70 this.__lastFocusableNode = newValue; |
| 71 } |
| 72 }); |
OLD | NEW |