mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Make pads with long lines usable with chrome.
- Do not use incorpIfQuick on keyup because it's not ever quick on chrome. Calling incorpIfQuick calls incorporateUserChanges which sets a flag on the current callstack state indicating that the selection has changed (since something was typed). Whenever this flag is set, the event handler will run code to update the selection (and possibly scroll the view as well), which is a very costly operation in webkit browsers. Instead let the user changes be incorporated by the idle worker, scheduling it to run ASAP on keyup. This isn't a perfect solution, but may make pads running on webkit browsers more usable with otherwise fairly unnoticeable changes in the UI.
This commit is contained in:
parent
d5a3d9d03b
commit
3a47e719d4
1 changed files with 2 additions and 2 deletions
|
@ -3855,7 +3855,7 @@ function Ace2Inner(){
|
|||
}
|
||||
else if (type == "keyup")
|
||||
{
|
||||
var wait = 200;
|
||||
var wait = 0;
|
||||
idleWorkTimer.atLeast(wait);
|
||||
idleWorkTimer.atMost(wait);
|
||||
}
|
||||
|
@ -3875,7 +3875,7 @@ function Ace2Inner(){
|
|||
|
||||
if ((!specialHandled) && (!thisKeyDoesntTriggerNormalize) && (!inInternationalComposition))
|
||||
{
|
||||
if (type != "keyup" || !incorpIfQuick())
|
||||
if (type != "keyup")
|
||||
{
|
||||
observeChangesAroundSelection();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue