| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Polymer({ | 5 Polymer({ |
| 6 is: 'viewer-error-screen', | 6 is: 'viewer-error-screen', |
| 7 properties: { | 7 properties: { |
| 8 reloadFn: { | 8 reloadFn: {type: Object, value: null, observer: 'reloadFnChanged_'}, |
| 9 type: Object, | |
| 10 value: null, | |
| 11 observer: 'reloadFnChanged_' | |
| 12 }, | |
| 13 | 9 |
| 14 strings: Object, | 10 strings: Object, |
| 15 }, | 11 }, |
| 16 | 12 |
| 17 reloadFnChanged_: function() { | 13 reloadFnChanged_: function() { |
| 18 // The default margins in paper-dialog don't work well with hiding/showing | 14 // The default margins in paper-dialog don't work well with hiding/showing |
| 19 // the .buttons div. We need to manually manage the bottom margin to get | 15 // the .buttons div. We need to manually manage the bottom margin to get |
| 20 // around this. | 16 // around this. |
| 21 if (this.reloadFn) | 17 if (this.reloadFn) |
| 22 this.$['load-failed-message'].classList.remove('last-item'); | 18 this.$['load-failed-message'].classList.remove('last-item'); |
| 23 else | 19 else |
| 24 this.$['load-failed-message'].classList.add('last-item'); | 20 this.$['load-failed-message'].classList.add('last-item'); |
| 25 }, | 21 }, |
| 26 | 22 |
| 27 show: function() { | 23 show: function() { |
| 28 this.$.dialog.open(); | 24 this.$.dialog.open(); |
| 29 }, | 25 }, |
| 30 | 26 |
| 31 reload: function() { | 27 reload: function() { |
| 32 if (this.reloadFn) | 28 if (this.reloadFn) |
| 33 this.reloadFn(); | 29 this.reloadFn(); |
| 34 } | 30 } |
| 35 }); | 31 }); |
| OLD | NEW |