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