OLD | NEW |
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.MouseFocusBehavior, | 9 bookmarks.MouseFocusBehavior, |
10 bookmarks.StoreClient, | 10 bookmarks.StoreClient, |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 }, | 276 }, |
277 | 277 |
278 /** | 278 /** |
279 * @param {!Event} e | 279 * @param {!Event} e |
280 * @private | 280 * @private |
281 */ | 281 */ |
282 onContextMenu_: function(e) { | 282 onContextMenu_: function(e) { |
283 e.preventDefault(); | 283 e.preventDefault(); |
284 this.selectFolder_(); | 284 this.selectFolder_(); |
285 bookmarks.CommandManager.getInstance().openCommandMenuAtPosition( | 285 bookmarks.CommandManager.getInstance().openCommandMenuAtPosition( |
286 e.clientX, e.clientY, new Set([this.itemId])); | 286 e.clientX, e.clientY, MenuSource.TREE, new Set([this.itemId])); |
287 }, | 287 }, |
288 | 288 |
289 /** | 289 /** |
290 * @private | 290 * @private |
291 * @return {!Array<!BookmarksFolderNodeElement>} | 291 * @return {!Array<!BookmarksFolderNodeElement>} |
292 */ | 292 */ |
293 getChildFolderNodes_: function() { | 293 getChildFolderNodes_: function() { |
294 return Array.from(this.root.querySelectorAll('bookmarks-folder-node')); | 294 return Array.from(this.root.querySelectorAll('bookmarks-folder-node')); |
295 }, | 295 }, |
296 | 296 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 * @param {boolean} isClosed | 378 * @param {boolean} isClosed |
379 * @private | 379 * @private |
380 */ | 380 */ |
381 updateAriaExpanded_: function(hasChildFolder, isClosed) { | 381 updateAriaExpanded_: function(hasChildFolder, isClosed) { |
382 if (hasChildFolder) | 382 if (hasChildFolder) |
383 this.getFocusTarget().setAttribute('aria-expanded', String(!isClosed)); | 383 this.getFocusTarget().setAttribute('aria-expanded', String(!isClosed)); |
384 else | 384 else |
385 this.getFocusTarget().removeAttribute('aria-expanded'); | 385 this.getFocusTarget().removeAttribute('aria-expanded'); |
386 }, | 386 }, |
387 }); | 387 }); |
OLD | NEW |