Cleaning up MKWS-58.
authorMike Taylor <mike@indexdata.com>
Mon, 9 Mar 2015 17:13:43 +0000 (17:13 +0000)
committerMike Taylor <mike@indexdata.com>
Mon, 9 Mar 2015 17:13:43 +0000 (17:13 +0000)
Remove unnecessary named function setRecordData(), used only once.
Just use a closure.

src/mkws-widget-main.js

index e264eba..3e7ec3d 100644 (file)
@@ -149,14 +149,12 @@ mkws.registerWidgetType('records', function() {
   }
 
   var m_frozen = false;
-  function setRecordData(data) {
+  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() {