Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: components/physical_web/webui/resources/physical_web.js

Issue 2717363003: Add Physical Web WebUI Default Url Icon (Closed)
Patch Set: use image directly Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « components/physical_web/webui/physical_web_ui_constants.cc ('k') | components/resources/physical_web_ui_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698