| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 this._sourcePosition.setText(WebInspector.UIString("%d characters se
lected", selectedText.length)); | 627 this._sourcePosition.setText(WebInspector.UIString("%d characters se
lected", selectedText.length)); |
| 628 else | 628 else |
| 629 this._sourcePosition.setText(WebInspector.UIString("%d lines, %d cha
racters selected", textRange.endLine - textRange.startLine + 1, selectedText.len
gth)); | 629 this._sourcePosition.setText(WebInspector.UIString("%d lines, %d cha
racters selected", textRange.endLine - textRange.startLine + 1, selectedText.len
gth)); |
| 630 }, | 630 }, |
| 631 | 631 |
| 632 /** | 632 /** |
| 633 * @param {number} lineNumber | 633 * @param {number} lineNumber |
| 634 */ | 634 */ |
| 635 scrollChanged: function(lineNumber) | 635 scrollChanged: function(lineNumber) |
| 636 { | 636 { |
| 637 this.dispatchEventToListeners(WebInspector.SourceFrame.Events.ScrollChan
ged, lineNumber); | 637 if (this._scrollTimer) |
| 638 clearTimeout(this._scrollTimer); |
| 639 this._scrollTimer = setTimeout(this.dispatchEventToListeners.bind(this,
WebInspector.SourceFrame.Events.ScrollChanged, lineNumber), 100); |
| 638 }, | 640 }, |
| 639 | 641 |
| 640 _handleKeyDown: function(e) | 642 _handleKeyDown: function(e) |
| 641 { | 643 { |
| 642 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); | 644 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); |
| 643 var handler = this._shortcuts[shortcutKey]; | 645 var handler = this._shortcuts[shortcutKey]; |
| 644 if (handler && handler()) | 646 if (handler && handler()) |
| 645 e.consume(true); | 647 e.consume(true); |
| 646 }, | 648 }, |
| 647 | 649 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 /** | 722 /** |
| 721 * @override | 723 * @override |
| 722 * @param {?WebInspector.TextRange} from | 724 * @param {?WebInspector.TextRange} from |
| 723 * @param {?WebInspector.TextRange} to | 725 * @param {?WebInspector.TextRange} to |
| 724 */ | 726 */ |
| 725 onJumpToPosition: function(from, to) | 727 onJumpToPosition: function(from, to) |
| 726 { | 728 { |
| 727 this._sourceFrame.onJumpToPosition(from, to); | 729 this._sourceFrame.onJumpToPosition(from, to); |
| 728 } | 730 } |
| 729 } | 731 } |
| OLD | NEW |