Chromium Code Reviews| Index: components/physical_web/webui/resources/physical_web.js |
| diff --git a/components/physical_web/webui/resources/physical_web.js b/components/physical_web/webui/resources/physical_web.js |
| index 70d856fe7db71a2222280e9cda9630a922507d4b..66bc21bd960e1c8677123f7e8565350f11344de4 100644 |
| --- a/components/physical_web/webui/resources/physical_web.js |
| +++ b/components/physical_web/webui/resources/physical_web.js |
| @@ -30,6 +30,18 @@ function returnNearbyURLs(nearbyUrlsData) { |
| var emptyMessage = $('empty-list-container'); |
| emptyMessage.hidden = false; |
| } |
| + assignImageLoadErrorHandlers(); |
| +} |
| + |
| +function assignImageLoadErrorHandlers() { |
| + var pwIcons = document.querySelectorAll('.physicalWebIcon'); |
| + pwIcons.forEach(function(e) { |
| + let img = e.getElementsByTagName('img')[0]; |
|
mmocny
2017/03/23 20:58:39
Could we just change the querySelectorAll to do th
Ran
2017/03/24 17:48:29
Done.
|
| + img.addEventListener('error', function() { |
| + img.src = |
| + 'chrome://physical-web/ic_link_grey600_36dp.png'; |
| + }); |
| + }); |
| } |
| document.addEventListener('DOMContentLoaded', requestNearbyURLs); |