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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 e.canExecute = true; | 454 e.canExecute = true; |
455 break; | 455 break; |
456 case 'sort-command': | 456 case 'sort-command': |
457 e.canExecute = !list.isSearch() && | 457 e.canExecute = !list.isSearch() && |
458 list.dataModel && list.dataModel.length > 1 && | 458 list.dataModel && list.dataModel.length > 1 && |
459 !isUnmodifiable(tree.getBookmarkNodeById(list.parentId)); | 459 !isUnmodifiable(tree.getBookmarkNodeById(list.parentId)); |
460 break; | 460 break; |
461 case 'undo-command': | 461 case 'undo-command': |
462 // The global undo command has no visible UI, so always enable it, and | 462 // The global undo command has no visible UI, so always enable it, and |
463 // just make it a no-op if undo is not possible. | 463 // just make it a no-op if undo is not possible. |
464 e.canExecute = true; | 464 // Just to serprate undo on search text box to be handled |
465 var input = $('term'); | |
yosin_UTC9
2014/07/18 01:34:24
nit: Since |input| is used once, we don't need to
chhajer.m
2014/07/18 07:49:46
Done.
| |
466 if (e.currentTarget.activeElement == input) | |
467 e.canExecute = false; | |
468 else | |
469 e.canExecute = true; | |
465 break; | 470 break; |
466 default: | 471 default: |
467 canExecuteForList(e); | 472 canExecuteForList(e); |
468 break; | 473 break; |
469 } | 474 } |
470 } | 475 } |
471 | 476 |
472 /** | 477 /** |
473 * Helper function for handling canExecute for the list and the tree. | 478 * Helper function for handling canExecute for the list and the tree. |
474 * @param {!Event} e Can execute event object. | 479 * @param {!Event} e Can execute event object. |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1377 | 1382 |
1378 cr.ui.FocusOutlineManager.forDocument(document); | 1383 cr.ui.FocusOutlineManager.forDocument(document); |
1379 initializeSplitter(); | 1384 initializeSplitter(); |
1380 bmm.addBookmarkModelListeners(); | 1385 bmm.addBookmarkModelListeners(); |
1381 dnd.init(selectItemsAfterUserAction); | 1386 dnd.init(selectItemsAfterUserAction); |
1382 tree.reload(); | 1387 tree.reload(); |
1383 } | 1388 } |
1384 | 1389 |
1385 initializeBookmarkManager(); | 1390 initializeBookmarkManager(); |
1386 })(); | 1391 })(); |
OLD | NEW |