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

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

Issue 2813503002: MD Bookmarks: Prevent navigating to invalid folders (Closed)
Patch Set: handleAction -> dispatch Created 3 years, 7 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-item', 6 is: 'bookmarks-item',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 this.dispatch(bookmarks.actions.selectItem( 100 this.dispatch(bookmarks.actions.selectItem(
101 this.itemId, e.ctrlKey, e.shiftKey, this.getState())); 101 this.itemId, e.ctrlKey, e.shiftKey, this.getState()));
102 e.stopPropagation(); 102 e.stopPropagation();
103 }, 103 },
104 104
105 /** 105 /**
106 * @param {Event} e 106 * @param {Event} e
107 * @private 107 * @private
108 */ 108 */
109 onDblClick_: function(e) { 109 onDblClick_: function(e) {
110 if (!this.item_.url) 110 if (!this.item_.url) {
111 this.dispatch(bookmarks.actions.selectFolder(this.item_.id)); 111 this.dispatch(
112 else 112 bookmarks.actions.selectFolder(this.item_.id, this.getState().nodes));
113 } else {
113 chrome.tabs.create({url: this.item_.url}); 114 chrome.tabs.create({url: this.item_.url});
115 }
114 }, 116 },
115 117
116 /** 118 /**
117 * @param {string} url 119 * @param {string} url
118 * @private 120 * @private
119 */ 121 */
120 updateFavicon_: function(url) { 122 updateFavicon_: function(url) {
121 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); 123 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
122 }, 124 },
123 }); 125 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/folder_node.js ('k') | chrome/browser/resources/md_bookmarks/reducers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698