Cleaning up MKWS-58.
[mkws-moved-to-github.git] / src / mkws-widget-main.js
index 017ce65..3e7ec3d 100644 (file)
@@ -113,14 +113,13 @@ mkws.registerWidgetType('details', function() {
 mkws.registerWidgetType('records', function() {
   var that = this;
   var team = this.team;
-  var m_dataToRedraw = null;
-  var m_frozen = false;
 
   this.team.queue("searchtriggered").subscribe(function() {
     var op = that.config.newsearch_opacity;
     if (op !== undefined) { that.node.fadeTo(500, op); }
   });
 
+  var m_dataToRedraw = null;
   function refreshRecordData() {
     that.node.css('opacity', 1);
 
@@ -149,14 +148,13 @@ mkws.registerWidgetType('records', function() {
     m_dataToRedraw = null;
   }
 
-  function setRecordData(data) {
+  var m_frozen = false;
+  this.team.queue("records").subscribe(function(data) {
     m_dataToRedraw = data;
     if (!m_frozen) {
       refreshRecordData();
     }
-  }
-
-  this.team.queue("records").subscribe(setRecordData);
+  });
 
   var m_timer;
   this.node.mousemove(function() {