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-pages' is the element that controls paging in the |
| 7 * user manager screen. |
| 8 * |
| 9 * @element user-manager-pages |
| 10 */ |
| 11 Polymer({ |
| 12 is: 'user-manager-pages', |
| 13 |
| 14 properties: { |
| 15 /** |
| 16 * ID of the currently selected page. |
| 17 * @private {string} |
| 18 */ |
| 19 selectedPage_: { |
| 20 type: String, |
| 21 value: 'user-pods-page' |
| 22 } |
| 23 }, |
| 24 |
| 25 listeners: { |
| 26 'change-page': 'changePage_' |
| 27 }, |
| 28 |
| 29 /** |
| 30 * Changes the currently selected page. |
| 31 * @param {Event} e The event containing ID of the selected page. |
| 32 * @private |
| 33 */ |
| 34 changePage_: function(e) { |
| 35 this.selectedPage_ = e.detail.page; |
| 36 }, |
| 37 |
| 38 /** |
| 39 * Returns True if the given page should be visible. |
| 40 * @param {string} selectedPage ID of the currently selected page. |
| 41 * @param {string} page ID of the given page. |
| 42 * @return {boolean} |
| 43 */ |
| 44 isPageVisible_: function(selectedPage, page) { |
| 45 return this.selectedPage_ == page; |
| 46 } |
| 47 }); |
OLD | NEW |