Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 (function() { | 5 (function() { |
| 6 /** @const */ var BookmarkList = bmm.BookmarkList; | 6 /** @const */ var BookmarkList = bmm.BookmarkList; |
| 7 /** @const */ var BookmarkTree = bmm.BookmarkTree; | 7 /** @const */ var BookmarkTree = bmm.BookmarkTree; |
| 8 /** @const */ var Command = cr.ui.Command; | 8 /** @const */ var Command = cr.ui.Command; |
| 9 /** @const */ var CommandBinding = cr.ui.CommandBinding; | 9 /** @const */ var CommandBinding = cr.ui.CommandBinding; |
| 10 /** @const */ var LinkKind = cr.LinkKind; | 10 /** @const */ var LinkKind = cr.LinkKind; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 // We need to verify that this is a correct ID. | 232 // We need to verify that this is a correct ID. |
| 233 chrome.bookmarks.get(id, function(items) { | 233 chrome.bookmarks.get(id, function(items) { |
| 234 if (items && items.length == 1) | 234 if (items && items.length == 1) |
| 235 updateParentId(id); | 235 updateParentId(id); |
| 236 }); | 236 }); |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 // Activate is handled by the open-in-same-window-command. | 240 // Activate is handled by the open-in-same-window-command. |
| 241 function handleDoubleClickForList(e) { | 241 function handleDoubleClickForList(e) { |
| 242 var target = e.target; | |
| 243 target = list.getListItemAncestor(target); | |
| 244 | |
| 245 var index = target ? list.getIndexOfListItem(target) : -1; | |
| 246 var sm = list.selectionModel; | |
| 247 var indexSelected = sm.getIndexSelected(index); | |
| 248 if (!indexSelected) | |
|
arv (Not doing code reviews)
2014/09/02 17:17:32
index 0 is also a valid index.
b.rout
2014/09/03 09:01:13
right, index 0 is a valid index. But, getIndexSele
arv (Not doing code reviews)
2014/09/04 15:19:20
You are right. I was not reading this thoroughly.
| |
| 249 list.handlePointerDownUp_(e); | |
|
arv (Not doing code reviews)
2014/09/02 17:17:32
This does not seem like the correct fix.
The list
b.rout
2014/09/03 09:01:13
There is already a dblclick listener in the cr/ui/
arv (Not doing code reviews)
2014/09/04 15:19:20
I would prefer that this is handled in list. A Ctr
b.rout
2014/09/05 09:16:53
Done.
| |
| 250 | |
| 242 if (e.button == 0) | 251 if (e.button == 0) |
| 243 $('open-in-same-window-command').execute(); | 252 $('open-in-same-window-command').execute(); |
| 244 } | 253 } |
| 245 | 254 |
| 246 // The list dispatches an event when the user clicks on the URL or the Show in | 255 // The list dispatches an event when the user clicks on the URL or the Show in |
| 247 // folder part. | 256 // folder part. |
| 248 function handleUrlClickedForList(e) { | 257 function handleUrlClickedForList(e) { |
| 249 getLinkController().openUrlFromEvent(e.url, e.originalEvent); | 258 getLinkController().openUrlFromEvent(e.url, e.originalEvent); |
| 250 chrome.bookmarkManagerPrivate.recordLaunch(); | 259 chrome.bookmarkManagerPrivate.recordLaunch(); |
| 251 } | 260 } |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1369 | 1378 |
| 1370 cr.ui.FocusOutlineManager.forDocument(document); | 1379 cr.ui.FocusOutlineManager.forDocument(document); |
| 1371 initializeSplitter(); | 1380 initializeSplitter(); |
| 1372 bmm.addBookmarkModelListeners(); | 1381 bmm.addBookmarkModelListeners(); |
| 1373 dnd.init(selectItemsAfterUserAction); | 1382 dnd.init(selectItemsAfterUserAction); |
| 1374 tree.reload(); | 1383 tree.reload(); |
| 1375 } | 1384 } |
| 1376 | 1385 |
| 1377 initializeBookmarkManager(); | 1386 initializeBookmarkManager(); |
| 1378 })(); | 1387 })(); |
| OLD | NEW |