No need to stash the button object in this.button.
authorMike Taylor <mike@indexdata.com>
Mon, 11 Aug 2014 13:08:49 +0000 (14:08 +0100)
committerMike Taylor <mike@indexdata.com>
Mon, 11 Aug 2014 13:08:49 +0000 (14:08 +0100)
Just keep it in a local variable.

src/mkws-widget-builder.js

index 60ee37b..6468e86 100644 (file)
@@ -2,12 +2,12 @@ mkws.registerWidgetType('Builder', function() {
   var that = this;
   var team = this.team;
 
-  this.button = mkws.$('<button/>', {
+  var button = mkws.$('<button/>', {
     type: 'button',
     text: this.config.text || "Build!"
   });
-  this.node.append(this.button);
-  this.button.click(function() {
+  this.node.append(button);
+  button.click(function() {
     var   query = team.widget('Query').value();
     var    sort = team.widget('Sort').value();
     var perpage = team.widget('Perpage').value();