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 * 'site-details' show the details (permissions and usage) for a given origin | 7 * 'site-details' show the details (permissions and usage) for a given origin |
| 8 * under Site Settings. | 8 * under Site Settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 this.onClearStorage_(); | 82 this.onClearStorage_(); |
| 83 else | 83 else |
| 84 this.navigateBackIfNoData_(); | 84 this.navigateBackIfNoData_(); |
| 85 }, | 85 }, |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * Navigate back if the UI is empty (everything been cleared). | 88 * Navigate back if the UI is empty (everything been cleared). |
| 89 */ | 89 */ |
| 90 navigateBackIfNoData_: function() { | 90 navigateBackIfNoData_: function() { |
| 91 if (this.storedData_ == '' && !this.permissionShowing_()) | 91 if (this.storedData_ == '' && !this.permissionShowing_()) |
| 92 this.fire('subpage-back'); | 92 settings.navigateTo(settings.Route.SITE_SETTINGS_ALL); |
|
Finnur
2016/08/23 13:04:17
Hmmm... This is a bit problematic... :/
When you
tommycli
2016/08/23 16:35:28
Try changing it to settings.navigateToPreviousRout
| |
| 93 }, | 93 }, |
| 94 | 94 |
| 95 /** | 95 /** |
| 96 * Returns true if one or more permission is showing. | 96 * Returns true if one or more permission is showing. |
| 97 */ | 97 */ |
| 98 permissionShowing_: function() { | 98 permissionShowing_: function() { |
| 99 return Array.prototype.some.call( | 99 return Array.prototype.some.call( |
| 100 this.root.querySelectorAll('site-details-permission'), | 100 this.root.querySelectorAll('site-details-permission'), |
| 101 function(element) { return element.offsetHeight > 0; }); | 101 function(element) { return element.offsetHeight > 0; }); |
| 102 }, | 102 }, |
| 103 }); | 103 }); |
| OLD | NEW |