Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 6 * @fileoverview |
| 7 * 'settings-ui' implements the UI for the Settings page. | 7 * 'settings-ui' implements the UI for the Settings page. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| 11 * <settings-ui prefs="{{prefs}}"></settings-ui> | 11 * <settings-ui prefs="{{prefs}}"></settings-ui> |
| 12 */ | 12 */ |
| 13 Polymer({ | 13 Polymer({ |
| 14 is: 'settings-ui', | 14 is: 'settings-ui', |
| 15 | 15 |
| 16 properties: { | 16 properties: { |
| 17 /** | 17 /** |
| 18 * Preferences state. | 18 * Preferences state. |
| 19 * @type {?CrSettingsPrefsElement} | 19 * @type {?CrSettingsPrefsElement} |
| 20 */ | 20 */ |
| 21 prefs: Object, | 21 prefs: Object, |
| 22 | 22 |
| 23 /** @type {?settings.DirectionDelegate} */ | 23 /** @type {?settings.DirectionDelegate} */ |
| 24 directionDelegate: { | 24 directionDelegate: { |
| 25 observer: 'directionDelegateChanged_', | 25 observer: 'directionDelegateChanged_', |
| 26 type: Object, | 26 type: Object, |
| 27 }, | 27 }, |
| 28 }, | 28 }, |
| 29 | 29 |
| 30 listeners: { | |
| 31 'iron-select': 'onIronSelect_', | |
|
dschuyler
2016/05/03 22:57:56
I may be misunderstanding, but it looks like
iron-
Dan Beam
2016/05/03 23:28:37
Done.
| |
| 32 'paper-responsive-change': 'onPaperResponsiveChange_', | |
| 33 }, | |
| 34 | |
| 35 /** @private */ | |
| 36 onIronSelect_: function() { | |
| 37 this.classList.remove('narrowing'); | |
| 38 }, | |
| 39 | |
| 40 /** | |
| 41 * @param {!Event} e | |
| 42 * @private | |
| 43 */ | |
| 44 onPaperResponsiveChange_: function(e) { | |
| 45 e = /** @type {{detail: {narrow: boolean}}} */(e); | |
| 46 this.classList.toggle('narrowing', e.detail.narrow); | |
| 47 }, | |
| 48 | |
| 30 /** @private */ | 49 /** @private */ |
| 31 directionDelegateChanged_: function() { | 50 directionDelegateChanged_: function() { |
| 32 this.$.panel.rightDrawer = this.directionDelegate.isRtl(); | 51 this.$.panel.rightDrawer = this.directionDelegate.isRtl(); |
| 33 }, | 52 }, |
| 34 }); | 53 }); |
| OLD | NEW |