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

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

Issue 2645273002: [MD Bookmarks] Modify search to retain the previously selected folder. (Closed)
Patch Set: Merge and move selectedId update logic into one function. 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 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-folder-node', 6 is: 'bookmarks-folder-node',
7 7
8 properties: { 8 properties: {
9 /** @type {BookmarkTreeNode} */ 9 /** @type {BookmarkTreeNode} */
10 item: Object, 10 item: Object,
(...skipping 16 matching lines...) Expand all
27 /** 27 /**
28 * @private 28 * @private
29 * @return {string} 29 * @return {string}
30 */ 30 */
31 getArrowIcon_: function() { 31 getArrowIcon_: function() {
32 return this.item.isOpen ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; 32 return this.item.isOpen ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down';
33 }, 33 },
34 34
35 /** @private */ 35 /** @private */
36 selectFolder_: function() { 36 selectFolder_: function() {
37 this.fire('search-term-changed', '');
37 this.fire('selected-folder-changed', this.item.id); 38 this.fire('selected-folder-changed', this.item.id);
38 }, 39 },
39 40
40 /** 41 /**
41 * Occurs when the drop down arrow is tapped. 42 * Occurs when the drop down arrow is tapped.
42 * @private 43 * @private
43 */ 44 */
44 toggleFolder_: function() { 45 toggleFolder_: function() {
45 this.fire('folder-open-changed', { 46 this.fire('folder-open-changed', {
46 id: this.item.id, 47 id: this.item.id,
47 open: !this.item.isOpen, 48 open: !this.item.isOpen,
48 }); 49 });
49 }, 50 },
50 51
51 /** 52 /**
52 * @private 53 * @private
53 * @return {boolean} 54 * @return {boolean}
54 */ 55 */
55 hasChildFolder_: function() { 56 hasChildFolder_: function() {
56 for (var i = 0; i < this.item.children.length; i++) { 57 for (var i = 0; i < this.item.children.length; i++) {
57 if (!this.item.children[i].url) 58 if (!this.item.children[i].url)
58 return true; 59 return true;
59 } 60 }
60 return false; 61 return false;
61 }, 62 },
62 }); 63 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/router.js » ('j') | chrome/browser/resources/md_bookmarks/store.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698