| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --><html><head><dom-module id="ct-embedded-flakiness-dashboard"> |
| 6 | 6 <style> |
| 7 <polymer-element name="ct-embedded-flakiness-dashboard" attributes="test"> | |
| 8 <template> | |
| 9 <style> | |
| 10 :host { | 7 :host { |
| 11 display: block; | 8 display: block; |
| 12 } | 9 } |
| 13 #iframe { | 10 #iframe { |
| 14 border: none; | 11 border: none; |
| 15 width: 100%; | 12 width: 100%; |
| 16 } | 13 } |
| 17 </style> | 14 </style> |
| 18 <iframe id="iframe" flex></iframe> | 15 <template> |
| 16 <iframe id="iframe" flex=""></iframe> |
| 19 </template> | 17 </template> |
| 20 <script> | 18 <script> |
| 21 Polymer({ | 19 Polymer({ |
| 22 test: "", | 20 is: 'ct-embedded-flakiness-dashboard', |
| 23 | 21 properties: { |
| 24 ready: function() { | 22 test: { |
| 25 window.addEventListener('message', function(event) { | 23 type: String, |
| 24 value: '', |
| 25 notify: true, |
| 26 observer: 'testChanged' |
| 27 } |
| 28 }, |
| 29 ready: function () { |
| 30 window.addEventListener('message', function (event) { |
| 26 if (event.data.command != 'heightChanged') | 31 if (event.data.command != 'heightChanged') |
| 27 return; | 32 return; |
| 28 | |
| 29 this.$.iframe.style.height = event.data.height + 'px'; | 33 this.$.iframe.style.height = event.data.height + 'px'; |
| 30 }.bind(this)); | 34 }.bind(this)); |
| 31 }, | 35 }, |
| 32 | 36 testChanged: function () { |
| 33 testChanged: function() { | |
| 34 // Use location.replace so we don't create extraneous history events. | 37 // Use location.replace so we don't create extraneous history events. |
| 35 this.$.iframe.contentWindow.location.replace(this.test.embeddedFlakiness
DashboardURL()); | 38 this.$.iframe.contentWindow.location.replace(this.test.embeddedFlakiness
DashboardURL()); |
| 36 }, | 39 } |
| 37 | |
| 38 }); | 40 }); |
| 39 </script> | 41 </script> |
| 40 </polymer-element> | 42 </dom-module> |
| OLD | NEW |