Skip to content

Commit

Permalink
Fixing global collision between can.control and can.compute. 'binder'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Holzmann committed Jun 25, 2012
1 parent 5b3c277 commit 7aea624
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion control/control.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
steal('can/construct', function( $ ) {
(function() {


// ## control.js
// `can.Control`
Expand All @@ -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.
Expand Down Expand Up @@ -733,5 +735,7 @@ steal('can/construct', function( $ ) {
"focusout", "mouseenter", "mouseleave"], function( v ) {
processors[v] = basicProcessor;
});

}());

});
6 changes: 3 additions & 3 deletions observe/compute/compute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
});
}
Expand All @@ -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.