diff --git a/client/index.html b/client/index.html index 4977816..7aa67e5 100644 --- a/client/index.html +++ b/client/index.html @@ -172,6 +172,7 @@ } .span { position: absolute; + white-space: nowrap; } diff --git a/client/space.js b/client/space.js index ecd06fb..c9b694b 100644 --- a/client/space.js +++ b/client/space.js @@ -17,7 +17,15 @@ function mousemove(event) { save(dragging); } +let saving; +let queue; + function save(span) { + if (saving) { + queue = span; + return; + } + saving = true; window.emit('save_span', { thread: spaceId, id: span.id ? span.id.slice(4) : '', @@ -30,6 +38,11 @@ function save(span) { console.log('span save failed: ' + msg.message); if (!span.id) span.id = 'span' + msg.id; + saving = false; + if (queue) { + save(queue); + queue = null; + } }); }