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

Side by Side Diff: chrome/browser/resources/md_bookmarks/list.js

Issue 2639893006: [MD Bookmarks] Add lines between items and no search results message. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'bookmarks-list', 6 is: 'bookmarks-list',
7 7
8 properties: { 8 properties: {
9 /** @type {BookmarkTreeNode} */ 9 /** @type {BookmarkTreeNode} */
10 menuItem_: Object, 10 menuItem_: Object,
11 11
12 /** @type {Array<BookmarkTreeNode>} */ 12 /** @type {Array<BookmarkTreeNode>} */
13 displayedList: Array, 13 displayedList: Array,
14
15 searchTerm: String,
14 }, 16 },
15 17
16 listeners: { 18 listeners: {
17 'open-item-menu': 'onOpenItemMenu_', 19 'open-item-menu': 'onOpenItemMenu_',
18 }, 20 },
19 21
20 /** 22 /**
21 * @param {Event} e 23 * @param {Event} e
22 * @private 24 * @private
23 */ 25 */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 }, 76 },
75 77
76 /** @private */ 78 /** @private */
77 closeDropdownMenu_: function() { 79 closeDropdownMenu_: function() {
78 var menu = /** @type {!CrActionMenuElement} */ ( 80 var menu = /** @type {!CrActionMenuElement} */ (
79 this.$.dropdown); 81 this.$.dropdown);
80 menu.close(); 82 menu.close();
81 }, 83 },
82 84
83 /** @private */ 85 /** @private */
84 isListEmpty_: function() { 86 emptyListMessage_: function() {
87 var emptyListMessage = this.searchTerm ? 'noSearchResults' : 'emptyList';
88 return loadTimeData.getString(emptyListMessage);
89 },
90
91 /** @private */
92 isEmptyList_: function() {
85 return this.displayedList.length == 0; 93 return this.displayedList.length == 0;
86 } 94 },
95
96 /**
97 * @param {BookmarkTreeNode} item
98 * @private
99 */
100 isLastItem_: function(item) {
101 var lastItem = this.displayedList[this.displayedList.length - 1];
jiaxi 2017/01/19 04:50:57 item.index == this.displayedList.length - 1
angelayang 2017/01/19 05:00:23 Done.
102 return lastItem === item;
103 },
87 }); 104 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698