| 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 |
| 29 appealClosed_: { |
| 30 type: Boolean, |
| 31 value: function() { |
| 32 return !!(sessionStorage.appealClosed_ || localStorage.appealClosed_); |
| 33 }, |
| 34 }, |
| 28 }, | 35 }, |
| 29 | 36 |
| 30 listeners: { | 37 listeners: { |
| 31 'sideNav.iron-activate': 'onIronActivate_', | 38 'sideNav.iron-activate': 'onIronActivate_', |
| 32 }, | 39 }, |
| 33 | 40 |
| 41 /** @private */ |
| 42 onCloseAppealTap_: function() { |
| 43 sessionStorage.appealClosed_ = this.appealClosed_ = true; |
| 44 }, |
| 45 |
| 34 /** | 46 /** |
| 35 * @param {Event} event | 47 * @param {Event} event |
| 36 * @private | 48 * @private |
| 37 */ | 49 */ |
| 38 onIronActivate_: function(event) { | 50 onIronActivate_: function(event) { |
| 39 if (event.detail.item.id != 'advancedPage') | 51 if (event.detail.item.id != 'advancedPage') |
| 40 this.$$('app-drawer').close(); | 52 this.$$('app-drawer').close(); |
| 41 }, | 53 }, |
| 42 | 54 |
| 43 /** @private */ | 55 /** @private */ |
| 44 onMenuButtonTap_: function() { | 56 onMenuButtonTap_: function() { |
| 45 this.$$('app-drawer').toggle(); | 57 this.$$('app-drawer').toggle(); |
| 46 }, | 58 }, |
| 47 | 59 |
| 48 /** @private */ | 60 /** @private */ |
| 49 directionDelegateChanged_: function() { | 61 directionDelegateChanged_: function() { |
| 50 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 62 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
| 51 'right' : 'left'; | 63 'right' : 'left'; |
| 52 }, | 64 }, |
| 53 }); | 65 }); |
| OLD | NEW |