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

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

Issue 2926233002: MD Bookmarks: Add right-click context menu to sidebar folders (Closed)
Patch Set: Created 3 years, 6 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 * @private 249 * @private
250 * @return {string} 250 * @return {string}
251 */ 251 */
252 getFolderIcon_: function() { 252 getFolderIcon_: function() {
253 return this.isSelectedFolder_ ? 'bookmarks:folder-open' : 'cr:folder'; 253 return this.isSelectedFolder_ ? 'bookmarks:folder-open' : 'cr:folder';
254 }, 254 },
255 255
256 /** @private */ 256 /** @private */
257 selectFolder_: function() { 257 selectFolder_: function() {
258 this.dispatch( 258 this.dispatch(
259 bookmarks.actions.selectFolder(this.item_.id, this.getState().nodes)); 259 bookmarks.actions.selectFolder(this.itemId, this.getState().nodes));
260 }, 260 },
261 261
262 /** 262 /**
263 * @param {!Event} e
264 * @private
265 */
266 onContextMenu_: function(e) {
267 e.preventDefault();
268 this.selectFolder_();
calamity 2017/06/13 05:54:25 This clears the current selection in the list. Is
tsergeant 2017/06/13 07:01:54 Yeah, this is intentional (and matches the old BMM
calamity 2017/06/15 03:48:52 Sorry, I mean it clears the current selection in t
tsergeant 2017/06/15 05:50:26 Ah, I see. This was a problem with just left-click
269 bookmarks.CommandManager.getInstance().openCommandMenuAtPosition(
270 e.clientX, e.clientY, new Set([this.itemId]));
271 },
272
273 /**
263 * @private 274 * @private
264 * @return {!Array<!BookmarksFolderNodeElement>} 275 * @return {!Array<!BookmarksFolderNodeElement>}
265 */ 276 */
266 getChildFolderNodes_: function() { 277 getChildFolderNodes_: function() {
267 return Array.from(this.root.querySelectorAll('bookmarks-folder-node')); 278 return Array.from(this.root.querySelectorAll('bookmarks-folder-node'));
268 }, 279 },
269 280
270 /** 281 /**
271 * Occurs when the drop down arrow is tapped. 282 * Occurs when the drop down arrow is tapped.
272 * @private 283 * @private
273 * @param {!Event} e 284 * @param {!Event} e
274 */ 285 */
275 toggleFolder_: function(e) { 286 toggleFolder_: function(e) {
276 this.dispatch( 287 this.dispatch(
277 bookmarks.actions.changeFolderOpen(this.item_.id, this.isClosed_)); 288 bookmarks.actions.changeFolderOpen(this.itemId, this.isClosed_));
278 e.stopPropagation(); 289 e.stopPropagation();
279 }, 290 },
280 291
281 /** 292 /**
282 * @private 293 * @private
283 * @param {!Event} e 294 * @param {!Event} e
284 */ 295 */
285 preventDefault_: function(e) { 296 preventDefault_: function(e) {
286 e.preventDefault(); 297 e.preventDefault();
287 }, 298 },
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 }, 346 },
336 347
337 /** 348 /**
338 * @private 349 * @private
339 * @return {string} 350 * @return {string}
340 */ 351 */
341 getTabIndex_: function() { 352 getTabIndex_: function() {
342 return this.isSelectedFolder_ ? '0' : ''; 353 return this.isSelectedFolder_ ? '0' : '';
343 }, 354 },
344 }); 355 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698