diff options
| author | Julie Lala <jules@okfoc.us> | 2013-12-19 10:08:32 -0500 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2013-12-19 10:08:32 -0500 |
| commit | 8ba7f3baf74a407a7c0005ab2aa1ecb5e36ef60f (patch) | |
| tree | f7d38fbfa7db775dc9297f6faa6215d112c84378 /js/record.concat.js | |
| parent | 4500b5b16284caee6de00c82a7bf42120fb35b80 (diff) | |
keyup nonoptimal
Diffstat (limited to 'js/record.concat.js')
| -rw-r--r-- | js/record.concat.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/js/record.concat.js b/js/record.concat.js index ce3f75d..b4715ac 100644 --- a/js/record.concat.js +++ b/js/record.concat.js @@ -951,13 +951,20 @@ function GifEncoder(){ curtain.addEventListener("mousedown", box_start, false) curtain.addEventListener("mousemove", box_size, false) curtain.addEventListener("mouseup", box_end, false) - w_el.addEventListener("keyup", box_position, false) - h_el.addEventListener("keyup", box_position, false) - x_el.addEventListener("keyup", box_position, false) - y_el.addEventListener("keyup", box_position, false) + w_el.addEventListener("change", box_position, false) + h_el.addEventListener("change", box_position, false) + x_el.addEventListener("change", box_position, false) + y_el.addEventListener("change", box_position, false) outline.style.display = "none" controls.style.display = "block" } + function defer(callback){ + var timeout = null + return function(){ + clearTimeout(timeout) + timeout = setTimeout(callback, 300) + } + } function box_start(e){ e.stopPropagation() x = e.pageX @@ -985,6 +992,7 @@ function GifEncoder(){ outline.style.width = px(w) outline.style.height = px(h) outline.style.display = "block" + enable("record") } function box_size(e){ if (! dragging) return @@ -997,7 +1005,6 @@ function GifEncoder(){ e.preventDefault() dragging = false controls.style.display = "block" - enable("record") document.getElementById("record").focus() } function _int(el){ return parseInt(el.value) } |
