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} | |
20 */ | 19 */ |
21 prefs: Object, | 20 prefs: Object, |
22 | 21 |
23 /** @type {?settings.DirectionDelegate} */ | 22 /** @type {?settings.DirectionDelegate} */ |
24 directionDelegate: { | 23 directionDelegate: { |
25 observer: 'directionDelegateChanged_', | 24 observer: 'directionDelegateChanged_', |
26 type: Object, | 25 type: Object, |
27 }, | 26 }, |
28 | 27 |
| 28 /** @private */ |
29 appealClosed_: { | 29 appealClosed_: { |
30 type: Boolean, | 30 type: Boolean, |
31 value: function() { | 31 value: function() { |
32 return !!(sessionStorage.appealClosed_ || localStorage.appealClosed_); | 32 return !!(window.sessionStorage.appealClosed_ || |
| 33 window.localStorage.appealClosed_); |
33 }, | 34 }, |
34 }, | 35 }, |
35 | 36 |
36 /** @private */ | 37 /** @private */ |
37 appealBugUrl_: { | 38 appealBugUrl_: { |
38 type: String, | 39 type: String, |
39 value: function() { | 40 value: function() { |
40 var url = | 41 var url = |
41 'https://bugs.chromium.org/p/chromium/issues/entry?' + | 42 'https://bugs.chromium.org/p/chromium/issues/entry?' + |
42 'labels=Proj-MaterialDesign-WebUI,Pri-2,Type-Bug&' + | 43 'labels=Proj-MaterialDesign-WebUI,Pri-2,Type-Bug&' + |
(...skipping 11 matching lines...) Expand all Loading... |
54 }, | 55 }, |
55 }, | 56 }, |
56 }, | 57 }, |
57 | 58 |
58 listeners: { | 59 listeners: { |
59 'sideNav.iron-activate': 'onIronActivate_', | 60 'sideNav.iron-activate': 'onIronActivate_', |
60 }, | 61 }, |
61 | 62 |
62 /** @private */ | 63 /** @private */ |
63 onCloseAppealTap_: function() { | 64 onCloseAppealTap_: function() { |
64 sessionStorage.appealClosed_ = this.appealClosed_ = true; | 65 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; |
65 }, | 66 }, |
66 | 67 |
67 /** | 68 /** |
68 * @param {Event} event | 69 * @param {Event} event |
69 * @private | 70 * @private |
70 */ | 71 */ |
71 onIronActivate_: function(event) { | 72 onIronActivate_: function(event) { |
72 if (event.detail.item.id != 'advancedPage') | 73 if (event.detail.item.id != 'advancedPage') |
73 this.$$('app-drawer').close(); | 74 this.$$('app-drawer').close(); |
74 }, | 75 }, |
75 | 76 |
76 /** @private */ | 77 /** @private */ |
77 onMenuButtonTap_: function() { | 78 onMenuButtonTap_: function() { |
78 this.$$('app-drawer').toggle(); | 79 this.$$('app-drawer').toggle(); |
79 }, | 80 }, |
80 | 81 |
81 /** @override */ | 82 /** @override */ |
82 ready: function() { | 83 ready: function() { |
83 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { | 84 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { |
84 this.$$('settings-main').searchContents(e.detail); | 85 this.$$('settings-main').searchContents(e.detail); |
85 }.bind(this)); | 86 }.bind(this)); |
86 }, | 87 }, |
87 | 88 |
88 /** @private */ | 89 /** @private */ |
89 directionDelegateChanged_: function() { | 90 directionDelegateChanged_: function() { |
90 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 91 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
91 'right' : 'left'; | 92 'right' : 'left'; |
92 }, | 93 }, |
93 }); | 94 }); |
OLD | NEW |