Only show cammie controls when moving mouse
This commit is contained in:
parent
38f735e7af
commit
a2c7746161
1 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
# Reworked version of the underscorejs debounce
|
||||
debounce = (func, wait, initial = () -> ) ->
|
||||
timeout = false
|
||||
() ->
|
||||
context = this
|
||||
args = arguments
|
||||
later = () ->
|
||||
timeout = null
|
||||
func.apply context, args
|
||||
callNow = !timeout
|
||||
clearTimeout timeout
|
||||
timeout = setTimeout later, wait
|
||||
initial.apply context, args if callNow
|
||||
|
||||
$ "#cammie-body"
|
||||
.mousemove debounce () ->
|
||||
$ this
|
||||
.removeClass 'display'
|
||||
, 3000, () ->
|
||||
$ this
|
||||
.addClass 'display'
|
Loading…
Reference in a new issue