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

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

Issue 2698503004: Add empty list indicator for Physical Web WebUI (Closed)
Patch Set: rebase Created 3 years, 10 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 418dc1d6e90c1b5e8daffb35b8fbd841900eae08..9231430fd03c52776adb690e5564dd27ce9d2778 100644
--- a/components/physical_web/webui/resources/physical_web.js
+++ b/components/physical_web/webui/resources/physical_web.js
@@ -21,11 +21,24 @@ function physicalWebItemClicked(index) {
chrome.send('physicalWebItemClicked', [index]);
}
+function clearScanNotification() {
cco3 2017/02/23 20:07:31 I think the language of "notification" is a bit co
Ran 2017/02/23 20:59:46 Done.
+ var scanningContainer = $('scan-container');
cco3 2017/02/23 20:07:31 This selector isn't going to work. You need the
Ran 2017/02/23 20:59:46 I was referring the "body-container". If I add the
+ scanningContainer.style.visibility = 'hidden';
+}
+
function returnNearbyURLs(nearbyUrlsData) {
var bodyContainer = $('body-container');
renderTemplate(nearbyUrlsData);
-
bodyContainer.style.visibility = 'visible';
+
+ clearScanNotification();
mattreynolds 2017/02/23 20:18:42 How long does it normally take to receive the URLs
Ran 2017/02/23 20:59:46 It's very fast, when I am doing test, I did't see
mattreynolds 2017/02/23 22:58:19 With the current behavior it should always be inst
+ if (nearbyUrlsData['metadata'].length == 0) {
+ var emptyMessage = $('empty-container');
+ emptyMessage.style.visibility = 'visible';
+ }
}
document.addEventListener('DOMContentLoaded', requestNearbyURLs);
+document.addEventListener('DOMContentLoaded', function() {
+ setTimeout(clearScanNotification, 6000);
cco3 2017/02/23 20:07:31 Since we always return nearbyurls right away, this
Ran 2017/02/23 20:59:46 Removed. when I test, it gives the nearbyurls righ
+});

Powered by Google App Engine
This is Rietveld 408576698