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

Unified Diff: chrome/browser/resources/md_extensions/item_list.html

Issue 2974583003: MD Extensions: Show messages for no extensions, and for no search results (Closed)
Patch Set: update tests Created 3 years, 5 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: chrome/browser/resources/md_extensions/item_list.html
diff --git a/chrome/browser/resources/md_extensions/item_list.html b/chrome/browser/resources/md_extensions/item_list.html
index e4ad4abd4d1eea2a9f51475c2362236f0b0715e3..14883739fccf277e90e9799618f96e2207a4aa35 100644
--- a/chrome/browser/resources/md_extensions/item_list.html
+++ b/chrome/browser/resources/md_extensions/item_list.html
@@ -1,3 +1,4 @@
+<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
@@ -8,7 +9,7 @@
<dom-module id="extensions-item-list">
<template>
- <style>
+ <style include="cr-hidden-style">
:host {
@apply(--layout-vertical);
}
@@ -18,11 +19,29 @@
margin-top: 18px;
}
+ .empty-list-message {
+ align-items: center;
+ color: #6e6e6e;
+ display: flex;
+ flex: 1;
+ font-weight: 500;
+ justify-content: center;
+ }
+
.wrapper {
padding: 6px;
}
</style>
- <iron-list id="list" items="[[computeShownItems_(items.*, filter)]]"
+ <div id="no-items" class="empty-list-message"
Devlin 2017/07/10 20:23:53 If we wanted to be super fancy, we could do: #emp
scottchen 2017/07/10 22:13:40 I was trying to think of clever ways to do only 1
Devlin 2017/07/12 02:22:02 Given these are the (slightly) less common case, a
scottchen 2017/07/12 18:08:04 I tried to do as you suggested, then found out tha
+ hidden$="[[!shouldShowEmptyItemsMessage_(items.length)]]">
+ <span>$i18nRaw{noExtensionsOrApps}</span>
+ </div>
+ <div id="no-search-results" class="empty-list-message"
+ hidden$="[[!shouldShowEmptySearchMessage_(shownItems_.length)]]">
+ <span>$i18n{noSearchResults}</span>
+ </div>
+
+ <iron-list id="list" items="[[shownItems_]]"
as="item" grid>
<template>
<div class="wrapper">

Powered by Google App Engine
This is Rietveld 408576698