X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=a73a1afe6b5f84155072281a29e66fc4aea9083e;hp=c18b21b4914fca13b2ebdf9bcfd8faeb19e01287;hb=51fe6a6521ef94fed9a1b36daae52831b10e0269;hpb=9ab0068d70b290fd8aca5b81ac6d84f07cc5d023 diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index c18b21b..a73a1af 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -160,35 +160,23 @@ mkws.registerWidgetType('records', function() { this.team.queue("records").subscribe(setRecordData); - this.node.mouseenter(function() { + 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(); - }); - -/* - var m_busy = false; - this.node.mousemove(function() { - if (!m_busy) { - m_busy = true; - that.info("making semi-transparent in 0.001 s"); - that.node.fadeTo(1, 0.5, function() { - that.info("making opaque in 2 s"); - that.node.fadeTo(2000, 1, function() { - that.info("done making opaque"); - m_busy = false; - }); - }); - } - }); -*/ + } + this.node.mouseleave(unfreezeRecordDisplay); that.autosearch(); });