Permalink
Browse files

Fixing proxy, not bind

  • Loading branch information...
1 parent 79ed01b commit c7f7c3ae3c69683aa2319dd3711df7053e709235 @cartuchogl committed Sep 5, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 treecombos.jquery.js
View
@@ -38,12 +38,16 @@ function TreeCombos(options) {
this.options = $.extend(defaults, options);
}
+TreeCombos.prototype._onchange = function(event) {
+ this.update();
+};
+
TreeCombos.prototype.create = function() {
this._current_level = this.options.tree.children('li');
if (this._select == null) {
this._select = $(document.createElement('select'));
this._select.addClass('level' + this.options.level);
- this._select.change(this._onchange.bind(this));
+ this._select.change($.proxy(this, '_onchange'));
// TODO: support for mode
this.options.destination.append(this._select);
} else {
@@ -62,10 +66,6 @@ TreeCombos.prototype.create = function() {
this.destroyChilds(true);
};
-TreeCombos.prototype._onchange = function(event) {
- this.update();
-};
-
TreeCombos.prototype.destroyChilds = function(first) {
if (this._next) {
this._next.destroyChilds(false);

0 comments on commit c7f7c3a

Please sign in to comment.