Skip to content

Commit 7aea624

Browse files
author
Ralph Holzmann
committed
Fixing global collision between can.control and can.compute. 'binder'
1 parent 5b3c277 commit 7aea624

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

control/control.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
steal('can/construct', function( $ ) {
2+
(function() {
3+
24

35
// ## control.js
46
// `can.Control`
@@ -17,7 +19,7 @@ steal('can/construct', function( $ ) {
1719
extend = can.extend,
1820
each = can.each,
1921
slice = [].slice,
20-
paramReplacer = /\{([^\}]+)\}/g,
22+
paramReplacer = /\{([^\}]+)\}/g,
2123
special = can.getObject("$.event.special") || {},
2224

2325
// Binds an element, returns a function that unbinds.
@@ -733,5 +735,7 @@ steal('can/construct', function( $ ) {
733735
"focusout", "mouseenter", "mouseleave"], function( v ) {
734736
processors[v] = basicProcessor;
735737
});
738+
739+
}());
736740

737741
});

observe/compute/compute.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ steal('can/util', function(){
4141
// Calls `callback(newVal, oldVal)` everytime an observed property
4242
// called within `getterSetter` is changed and creates a new result of `getterSetter`.
4343
// Also returns an object that can teardown all event handlers.
44-
binder = function(getterSetter, context, callback){
44+
computeBinder = function(getterSetter, context, callback){
4545
// track what we are observing
4646
var observing = {},
4747
// a flag indicating if this observe/attr pair is already bound
@@ -308,7 +308,7 @@ steal('can/util', function(){
308308
can.addEvent.apply(computed, arguments);
309309
if( bindings === 0 && canbind){
310310
// setup live-binding
311-
computedData = binder(getterSetter, context || this, function(newValue, oldValue){
311+
computedData = computeBinder(getterSetter, context || this, function(newValue, oldValue){
312312
can.trigger(computed, "change",[newValue, oldValue])
313313
});
314314
}
@@ -328,5 +328,5 @@ steal('can/util', function(){
328328
};
329329
return computed;
330330
};
331-
can.compute.binder = binder;
331+
can.compute.binder = computeBinder;
332332
})

0 commit comments

Comments
 (0)