| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 346 |
| 347 this._topPaddingHeight = 0; | 347 this._topPaddingHeight = 0; |
| 348 this._bottomPaddingHeight = 0; | 348 this._bottomPaddingHeight = 0; |
| 349 | 349 |
| 350 this._addVisibleNodes(this.rootNode(), scrollTop, scrollTop + viewPortHeight
); | 350 this._addVisibleNodes(this.rootNode(), scrollTop, scrollTop + viewPortHeight
); |
| 351 | 351 |
| 352 this.setVerticalPadding(this._topPaddingHeight, this._bottomPaddingHeight); | 352 this.setVerticalPadding(this._topPaddingHeight, this._bottomPaddingHeight); |
| 353 | 353 |
| 354 if (selectedNode) { | 354 if (selectedNode) { |
| 355 // Keep selection even if the node is not in the current viewport. | 355 // Keep selection even if the node is not in the current viewport. |
| 356 if (selectedNode.parent) | 356 if (selectedNode.parent()) |
| 357 selectedNode.select(true); | 357 selectedNode.select(true); |
| 358 else | 358 else |
| 359 this.selectedNode = selectedNode; | 359 this.selectedNode = selectedNode; |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 | 362 |
| 363 /** | 363 /** |
| 364 * @param {!DataGrid.DataGridNode} parentNode | 364 * @param {!DataGrid.DataGridNode} parentNode |
| 365 * @param {number} topBound | 365 * @param {number} topBound |
| 366 * @param {number} bottomBound | 366 * @param {number} bottomBound |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 function compare(a, b) { | 1011 function compare(a, b) { |
| 1012 if (a[fieldName] > b[fieldName]) | 1012 if (a[fieldName] > b[fieldName]) |
| 1013 return compareResult; | 1013 return compareResult; |
| 1014 if (a[fieldName] < b[fieldName]) | 1014 if (a[fieldName] < b[fieldName]) |
| 1015 return -compareResult; | 1015 return -compareResult; |
| 1016 return 0; | 1016 return 0; |
| 1017 } | 1017 } |
| 1018 return compare; | 1018 return compare; |
| 1019 } | 1019 } |
| 1020 }; | 1020 }; |
| OLD | NEW |