Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pass the overwritten implementation to the builder

  • Loading branch information...
commit e7ce1839c0f663165371951c404a8b4f3462cb47 1 parent 8ec065b
@fgnass authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 jquery.dynaform.js
View
11 jquery.dynaform.js
@@ -56,11 +56,10 @@
},
register: function (builders) {
- // Add raw builders to prototype.builders
- $.extend(DynaForm.prototype.builders, builders);
-
$.each(builders, function (type, builder) {
- var prev = DynaForm.prototype[type];
+ var prev = DynaForm.prototype.builders[type];
+ DynaForm.prototype.builders[type] = builder;
+
DynaForm.prototype[type] = function () {
var args = $.makeArray(arguments),
shift = function (type) {
@@ -83,7 +82,9 @@
value: bind && this.data ? this.data[bind] : this.data
}
);
- var el = builder.call(this, options, prev).addClass(type);
+
+ var proxy = $.proxy(prev, this);
+ var el = builder.call(this, options, proxy).addClass(type);
if (options.label) {
el = $('<div class="labeled">')
Please sign in to comment.
Something went wrong with that request. Please try again.