A simpler pattern would be to use `bind`:

    ...onfoo = function() {
      this.$....
    }.bind(this);