From: Mike Taylor Date: Mon, 9 Mar 2015 16:49:48 +0000 (+0000) Subject: Progress of MKWS-58. X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=8e454e2925f75712eb67d0cd9a86cfc84e5c5605 Progress of MKWS-58. Record-display freeze now times out after 1000ms. --- diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index 446fe75..3af2257 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -160,18 +160,23 @@ mkws.registerWidgetType('records', function() { this.team.queue("records").subscribe(setRecordData); + var m_timer; this.node.mousemove(function() { that.info("freezing display records"); that.node.css('opacity', 0.5); m_frozen = true; + clearTimeout(m_timer); + m_timer = setTimeout(unfreezeRecordDisplay, 1000); }); - this.node.mouseleave(function() { + function unfreezeRecordDisplay() { + clearTimeout(m_timer); that.info("refreshing records"); that.node.css('opacity', 1); m_frozen = false; refreshRecordData(); - }); + } + this.node.mouseleave(unfreezeRecordDisplay); /* var m_busy = false;