| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 node: node, | 265 node: node, |
| 266 offset: offset | 266 offset: offset |
| 267 }; | 267 }; |
| 268 }, | 268 }, |
| 269 | 269 |
| 270 /** | 270 /** |
| 271 * @param {?Selection} selection | 271 * @param {?Selection} selection |
| 272 */ | 272 */ |
| 273 _updateSelectionModel: function(selection) | 273 _updateSelectionModel: function(selection) |
| 274 { | 274 { |
| 275 if (!selection || !selection.rangeCount) { | 275 if (!selection || !selection.rangeCount || selection.isCollapsed) { |
| 276 this._headSelection = null; | 276 this._headSelection = null; |
| 277 this._anchorSelection = null; | 277 this._anchorSelection = null; |
| 278 return false; | 278 return false; |
| 279 } | 279 } |
| 280 | 280 |
| 281 var firstSelected = Number.MAX_VALUE; | 281 var firstSelected = Number.MAX_VALUE; |
| 282 var lastSelected = -1; | 282 var lastSelected = -1; |
| 283 | 283 |
| 284 var range = selection.getRangeAt(0); | 284 var range = selection.getRangeAt(0); |
| 285 var hasVisibleSelection = false; | 285 var hasVisibleSelection = false; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 | 612 |
| 613 /** | 613 /** |
| 614 * @return {number} | 614 * @return {number} |
| 615 */ | 615 */ |
| 616 _visibleHeight: function() | 616 _visibleHeight: function() |
| 617 { | 617 { |
| 618 // Use offsetHeight instead of clientHeight to avoid being affected by h
orizontal scroll. | 618 // Use offsetHeight instead of clientHeight to avoid being affected by h
orizontal scroll. |
| 619 return this.element.offsetHeight; | 619 return this.element.offsetHeight; |
| 620 } | 620 } |
| 621 } | 621 } |
| OLD | NEW |