Permalink
Browse files

Fixing global collision between can.control and can.compute. 'binder'

  • Loading branch information...
Ralph Holzmann
Ralph Holzmann committed Jun 25, 2012
1 parent 5b3c277 commit 7aea62462f3d8d7855f71ccdf16330e60d59f6fa
Showing with 8 additions and 4 deletions.
  1. +5 −1 control/control.js
  2. +3 −3 observe/compute/compute.js
View
@@ -1,4 +1,6 @@
steal('can/construct', function( $ ) {
(function() {
// ## control.js
// `can.Control`
@@ -17,7 +19,7 @@ steal('can/construct', function( $ ) {
extend = can.extend,
each = can.each,
slice = [].slice,
paramReplacer = /\{([^\}]+)\}/g,
paramReplacer = /\{([^\}]+)\}/g,
special = can.getObject("$.event.special") || {},
// Binds an element, returns a function that unbinds.
@@ -733,5 +735,7 @@ steal('can/construct', function( $ ) {
"focusout", "mouseenter", "mouseleave"], function( v ) {
processors[v] = basicProcessor;
});
}());
});
@@ -41,7 +41,7 @@ steal('can/util', function(){
// Calls `callback(newVal, oldVal)` everytime an observed property
// called within `getterSetter` is changed and creates a new result of `getterSetter`.
// Also returns an object that can teardown all event handlers.
binder = function(getterSetter, context, callback){
computeBinder = function(getterSetter, context, callback){
// track what we are observing
var observing = {},
// a flag indicating if this observe/attr pair is already bound
@@ -308,7 +308,7 @@ steal('can/util', function(){
can.addEvent.apply(computed, arguments);
if( bindings === 0 && canbind){
// setup live-binding
computedData = binder(getterSetter, context || this, function(newValue, oldValue){
computedData = computeBinder(getterSetter, context || this, function(newValue, oldValue){
can.trigger(computed, "change",[newValue, oldValue])
});
}
@@ -328,5 +328,5 @@ steal('can/util', function(){
};
return computed;
};
can.compute.binder = binder;
can.compute.binder = computeBinder;
})

0 comments on commit 7aea624

Please sign in to comment.