Commit 8acd553f8fa30f4b8a87229695d165ff34d49efc
preview: add 50 ms delay to fast switching
Matt McKegg committed on 10/18/2017, 11:49:09 PMParent: f5348ec88b9679136249e371a55d68a8098e3979
Files changed
lib/observe-link-hover.js | changed |
lib/observe-link-hover.js | ||
---|---|---|
@@ -19,10 +19,10 @@ | ||
19 | 19 | }) |
20 | 20 | |
21 | 21 | var active = Value(false) |
22 | 22 | |
23 | - var result = Sustained(target, delay || 500, (v) => { | |
24 | - // immediately switch to new hover if there is a current hover in place | |
23 | + var result = Sustained(Sustained(target, 50), delay || 500, (v) => { | |
24 | + // immediately switch to new hover (with 50 ms delay) if there is a current hover in place | |
25 | 25 | return v === undefined || (active() && v && v !== result()) |
26 | 26 | }) |
27 | 27 | |
28 | 28 | result.cancel = () => target.set(undefined) |
Built with git-ssb-web