| 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 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** @const */ var BookmarkList = bmm.BookmarkList; | 8 /** @const */ var BookmarkList = bmm.BookmarkList; |
| 9 /** @const */ var BookmarkTree = bmm.BookmarkTree; | 9 /** @const */ var BookmarkTree = bmm.BookmarkTree; |
| 10 /** @const */ var Command = cr.ui.Command; | 10 /** @const */ var Command = cr.ui.Command; |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 id: 'new' | 1136 id: 'new' |
| 1137 }; | 1137 }; |
| 1138 var dataModel = bmm.list.dataModel; | 1138 var dataModel = bmm.list.dataModel; |
| 1139 var index = dataModel.length; | 1139 var index = dataModel.length; |
| 1140 if (newIndex != undefined) | 1140 if (newIndex != undefined) |
| 1141 index = newIndex; | 1141 index = newIndex; |
| 1142 dataModel.splice(index, 0, fakeNode); | 1142 dataModel.splice(index, 0, fakeNode); |
| 1143 var sm = bmm.list.selectionModel; | 1143 var sm = bmm.list.selectionModel; |
| 1144 sm.anchorIndex = sm.leadIndex = sm.selectedIndex = index; | 1144 sm.anchorIndex = sm.leadIndex = sm.selectedIndex = index; |
| 1145 scrollIntoViewAndMakeEditable(index); | 1145 scrollIntoViewAndMakeEditable(index); |
| 1146 }; | 1146 } |
| 1147 | 1147 |
| 1148 navigateTo(parentId, editNewBookmark); | 1148 navigateTo(parentId, editNewBookmark); |
| 1149 } | 1149 } |
| 1150 | 1150 |
| 1151 /** | 1151 /** |
| 1152 * This function is used to select items after a user action such as paste, drop | 1152 * This function is used to select items after a user action such as paste, drop |
| 1153 * add page etc. | 1153 * add page etc. |
| 1154 * @param {BookmarkList|BookmarkTree} target The target of the user action. | 1154 * @param {BookmarkList|BookmarkTree} target The target of the user action. |
| 1155 * @param {string=} opt_selectedTreeId If provided, then select that tree id. | 1155 * @param {string=} opt_selectedTreeId If provided, then select that tree id. |
| 1156 */ | 1156 */ |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 | 1533 |
| 1534 cr.ui.FocusOutlineManager.forDocument(document); | 1534 cr.ui.FocusOutlineManager.forDocument(document); |
| 1535 initializeSplitter(); | 1535 initializeSplitter(); |
| 1536 bmm.addBookmarkModelListeners(); | 1536 bmm.addBookmarkModelListeners(); |
| 1537 dnd.init(selectItemsAfterUserAction); | 1537 dnd.init(selectItemsAfterUserAction); |
| 1538 bmm.tree.reload(); | 1538 bmm.tree.reload(); |
| 1539 } | 1539 } |
| 1540 | 1540 |
| 1541 initializeBookmarkManager(); | 1541 initializeBookmarkManager(); |
| 1542 })(); | 1542 })(); |
| OLD | NEW |