| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview 'user-manager-pages' is the element that controls paging in the | 6 * @fileoverview 'user-manager-pages' is the element that controls paging in the |
| 7 * user manager screen. | 7 * user manager screen. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'user-manager-pages', | 10 is: 'user-manager-pages', |
| 11 | 11 |
| 12 properties: { | 12 properties: { |
| 13 /** | 13 /** |
| 14 * ID of the currently selected page. | 14 * ID of the currently selected page. |
| 15 * @private {string} | 15 * @private {string} |
| 16 */ | 16 */ |
| 17 selectedPage_: { | 17 selectedPage_: {type: String, value: 'user-pods-page'}, |
| 18 type: String, | |
| 19 value: 'user-pods-page' | |
| 20 }, | |
| 21 | 18 |
| 22 /** | 19 /** |
| 23 * Data passed to the currently selected page. | 20 * Data passed to the currently selected page. |
| 24 * @private {?Object} | 21 * @private {?Object} |
| 25 */ | 22 */ |
| 26 pageData_: { | 23 pageData_: {type: Object, value: null} |
| 27 type: Object, | |
| 28 value: null | |
| 29 } | |
| 30 }, | 24 }, |
| 31 | 25 |
| 32 listeners: { | 26 listeners: {'change-page': 'onChangePage_'}, |
| 33 'change-page': 'onChangePage_' | |
| 34 }, | |
| 35 | 27 |
| 36 /** | 28 /** |
| 37 * Handler for the change-page event. | 29 * Handler for the change-page event. |
| 38 * @param {Event} e The event containing ID of the page that is to be selected | 30 * @param {Event} e The event containing ID of the page that is to be selected |
| 39 * and the optional data to be passed to the page. | 31 * and the optional data to be passed to the page. |
| 40 * @private | 32 * @private |
| 41 */ | 33 */ |
| 42 onChangePage_: function(e) { | 34 onChangePage_: function(e) { |
| 43 this.setSelectedPage(e.detail.page, e.detail.data); | 35 this.setSelectedPage(e.detail.page, e.detail.data); |
| 44 }, | 36 }, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 * Returns True if the first argument is present in the given set of values. | 49 * Returns True if the first argument is present in the given set of values. |
| 58 * @param {string} selectedPage ID of the currently selected page. | 50 * @param {string} selectedPage ID of the currently selected page. |
| 59 * @param {...string} var_args Pages IDs to check the first argument against. | 51 * @param {...string} var_args Pages IDs to check the first argument against. |
| 60 * @return {boolean} | 52 * @return {boolean} |
| 61 */ | 53 */ |
| 62 isPresentIn_: function(selectedPage, var_args) { | 54 isPresentIn_: function(selectedPage, var_args) { |
| 63 var pages = Array.prototype.slice.call(arguments, 1); | 55 var pages = Array.prototype.slice.call(arguments, 1); |
| 64 return pages.indexOf(selectedPage) !== -1; | 56 return pages.indexOf(selectedPage) !== -1; |
| 65 } | 57 } |
| 66 }); | 58 }); |
| OLD | NEW |