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

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

Issue 2813503002: MD Bookmarks: Prevent navigating to invalid folders (Closed)
Patch Set: Add positive test case Created 3 years, 8 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 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 /** 61 /**
62 * @private 62 * @private
63 * @return {string} 63 * @return {string}
64 */ 64 */
65 getFolderIcon_: function() { 65 getFolderIcon_: function() {
66 return this.isSelectedFolder_ ? 'bookmarks:folder-open' : 'cr:folder'; 66 return this.isSelectedFolder_ ? 'bookmarks:folder-open' : 'cr:folder';
67 }, 67 },
68 68
69 /** @private */ 69 /** @private */
70 selectFolder_: function() { 70 selectFolder_: function() {
71 this.dispatch(bookmarks.actions.selectFolder(this.item_.id)); 71 this.dispatch(
72 bookmarks.actions.selectFolder(this.item_.id, this.getState().nodes));
72 }, 73 },
73 74
74 /** 75 /**
75 * Occurs when the drop down arrow is tapped. 76 * Occurs when the drop down arrow is tapped.
76 * @private 77 * @private
77 * @param {!Event} e 78 * @param {!Event} e
78 */ 79 */
79 toggleFolder_: function(e) { 80 toggleFolder_: function(e) {
80 this.dispatch( 81 this.dispatch(
81 bookmarks.actions.changeFolderOpen(this.item_.id, this.isClosed_)); 82 bookmarks.actions.changeFolderOpen(this.item_.id, this.isClosed_));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 }, 124 },
124 125
125 /** 126 /**
126 * @private 127 * @private
127 * @return {boolean} 128 * @return {boolean}
128 */ 129 */
129 isRootFolder_: function() { 130 isRootFolder_: function() {
130 return this.depth == 0; 131 return this.depth == 0;
131 }, 132 },
132 }); 133 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698