Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build v1.0.2

  • Loading branch information...
commit 7e36cf6704e7aedf0497b008fe7264fd4f06841e 1 parent c6c66a9
@derickbailey derickbailey authored
View
4 CHANGELOG.md
@@ -1,5 +1,9 @@
# Change log
+### v1.0.2
+
+* Fix for calling `.apply` with IE < 9, when `arguments` is null or undefined
+
### v1.0.1
* Throw an exception if the first argument to `bindTo` is null or undefined
View
9 lib/amd/backbone.eventbinder.js
@@ -1,4 +1,4 @@
-// Backbone.EventBinder, v1.0.1
+// Backbone.EventBinder, v1.0.2
// Copyright (c)2012 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
// http://github.com/marionettejs/backbone.eventbinder
@@ -111,7 +111,8 @@
var obj = arguments[0];
var handlers = getHandlerForObject(obj);
- var binding = handlers.bindTo.apply(this,arguments);
+ var args = Array.prototype.slice.apply(arguments);
+ var binding = handlers.bindTo.apply(this, args);
this._eventBindings.push(binding);
@@ -121,7 +122,9 @@
// Unbind from a single binding object. Binding objects are
// returned from the `bindTo` method call.
unbindFrom: function(binding) {
- handlerMap[binding.type].unbindFrom.apply(this,arguments);
+ var args = Array.prototype.slice.apply(arguments);
+ handlerMap[binding.type].unbindFrom.apply(this, args);
+
this._eventBindings = _.reject(this._eventBindings, function(bind){return bind === binding;});
},
View
4 lib/amd/backbone.eventbinder.min.js
@@ -1,5 +1,5 @@
-// Backbone.EventBinder, v1.0.1
+// Backbone.EventBinder, v1.0.2
// Copyright (c)2012 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
// http://github.com/marionettejs/backbone.eventbinder
-(function(e,t){if(typeof exports=="object"){var n=require("underscore"),r=require("backbone");module.exports=t(n,r)}else typeof define=="function"&&define.amd&&define(["underscore","backbone"],t)})(this,function(e,t){"option strict";return t.EventBinder=function(e,t){"use strict";function r(e){if(t.isUndefined(e)||t.isNull(e))throw new Error("Can't bindTo undefined");return e.jquery?n.jquery:n["default"]}var n={"default":{bindTo:function(e,t,n,r){r=r||this,e.on(t,n,r);var i={type:"default",obj:e,eventName:t,callback:n,context:r};return i},unbindFrom:function(e){e.obj.off(e.eventName,e.callback,e.context)}},jquery:{bindTo:function(e,n,r,i){i=i||this,r=t(r).bind(i),e.on(n,r);var s={type:"jquery",obj:e,eventName:n,callback:r,context:i};return s},unbindFrom:function(e){e.obj.off(e.eventName,e.callback)}}},i=function(){this._eventBindings=[]};return i.extend=e.View.extend,t.extend(i.prototype,{bindTo:function(){var e=arguments[0],t=r(e),n=t.bindTo.apply(this,arguments);return this._eventBindings.push(n),n},unbindFrom:function(e){n[e.type].unbindFrom.apply(this,arguments),this._eventBindings=t.reject(this._eventBindings,function(t){return t===e})},unbindAll:function(){var e=t.map(this._eventBindings,t.identity);t.each(e,this.unbindFrom,this)}}),i}(t,e),t.EventBinder});
+(function(e,t){if(typeof exports=="object"){var n=require("underscore"),r=require("backbone");module.exports=t(n,r)}else typeof define=="function"&&define.amd&&define(["underscore","backbone"],t)})(this,function(e,t){"option strict";return t.EventBinder=function(e,t){"use strict";function r(e){if(t.isUndefined(e)||t.isNull(e))throw new Error("Can't bindTo undefined");return e.jquery?n.jquery:n["default"]}var n={"default":{bindTo:function(e,t,n,r){r=r||this,e.on(t,n,r);var i={type:"default",obj:e,eventName:t,callback:n,context:r};return i},unbindFrom:function(e){e.obj.off(e.eventName,e.callback,e.context)}},jquery:{bindTo:function(e,n,r,i){i=i||this,r=t(r).bind(i),e.on(n,r);var s={type:"jquery",obj:e,eventName:n,callback:r,context:i};return s},unbindFrom:function(e){e.obj.off(e.eventName,e.callback)}}},i=function(){this._eventBindings=[]};return i.extend=e.View.extend,t.extend(i.prototype,{bindTo:function(){var e=arguments[0],t=r(e),n=Array.prototype.slice.apply(arguments),i=t.bindTo.apply(this,n);return this._eventBindings.push(i),i},unbindFrom:function(e){var r=Array.prototype.slice.apply(arguments);n[e.type].unbindFrom.apply(this,r),this._eventBindings=t.reject(this._eventBindings,function(t){return t===e})},unbindAll:function(){var e=t.map(this._eventBindings,t.identity);t.each(e,this.unbindFrom,this)}}),i}(t,e),t.EventBinder});
View
9 lib/backbone.eventbinder.js
@@ -1,4 +1,4 @@
-// Backbone.EventBinder, v1.0.1
+// Backbone.EventBinder, v1.0.2
// Copyright (c)2012 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
// http://github.com/marionettejs/backbone.eventbinder
@@ -95,7 +95,8 @@ Backbone.EventBinder = (function(Backbone, _){
var obj = arguments[0];
var handlers = getHandlerForObject(obj);
- var binding = handlers.bindTo.apply(this,arguments);
+ var args = Array.prototype.slice.apply(arguments);
+ var binding = handlers.bindTo.apply(this, args);
this._eventBindings.push(binding);
@@ -105,7 +106,9 @@ Backbone.EventBinder = (function(Backbone, _){
// Unbind from a single binding object. Binding objects are
// returned from the `bindTo` method call.
unbindFrom: function(binding) {
- handlerMap[binding.type].unbindFrom.apply(this,arguments);
+ var args = Array.prototype.slice.apply(arguments);
+ handlerMap[binding.type].unbindFrom.apply(this, args);
+
this._eventBindings = _.reject(this._eventBindings, function(bind){return bind === binding;});
},
View
4 lib/backbone.eventbinder.min.js
@@ -1,5 +1,5 @@
-// Backbone.EventBinder, v1.0.1
+// Backbone.EventBinder, v1.0.2
// Copyright (c)2012 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
// http://github.com/marionettejs/backbone.eventbinder
-Backbone.EventBinder=function(e,t){"use strict";function r(e){if(t.isUndefined(e)||t.isNull(e))throw new Error("Can't bindTo undefined");return e.jquery?n.jquery:n["default"]}var n={"default":{bindTo:function(e,t,n,r){r=r||this,e.on(t,n,r);var i={type:"default",obj:e,eventName:t,callback:n,context:r};return i},unbindFrom:function(e){e.obj.off(e.eventName,e.callback,e.context)}},jquery:{bindTo:function(e,n,r,i){i=i||this,r=t(r).bind(i),e.on(n,r);var s={type:"jquery",obj:e,eventName:n,callback:r,context:i};return s},unbindFrom:function(e){e.obj.off(e.eventName,e.callback)}}},i=function(){this._eventBindings=[]};return i.extend=e.View.extend,t.extend(i.prototype,{bindTo:function(){var e=arguments[0],t=r(e),n=t.bindTo.apply(this,arguments);return this._eventBindings.push(n),n},unbindFrom:function(e){n[e.type].unbindFrom.apply(this,arguments),this._eventBindings=t.reject(this._eventBindings,function(t){return t===e})},unbindAll:function(){var e=t.map(this._eventBindings,t.identity);t.each(e,this.unbindFrom,this)}}),i}(Backbone,_);
+Backbone.EventBinder=function(e,t){"use strict";function r(e){if(t.isUndefined(e)||t.isNull(e))throw new Error("Can't bindTo undefined");return e.jquery?n.jquery:n["default"]}var n={"default":{bindTo:function(e,t,n,r){r=r||this,e.on(t,n,r);var i={type:"default",obj:e,eventName:t,callback:n,context:r};return i},unbindFrom:function(e){e.obj.off(e.eventName,e.callback,e.context)}},jquery:{bindTo:function(e,n,r,i){i=i||this,r=t(r).bind(i),e.on(n,r);var s={type:"jquery",obj:e,eventName:n,callback:r,context:i};return s},unbindFrom:function(e){e.obj.off(e.eventName,e.callback)}}},i=function(){this._eventBindings=[]};return i.extend=e.View.extend,t.extend(i.prototype,{bindTo:function(){var e=arguments[0],t=r(e),n=Array.prototype.slice.apply(arguments),i=t.bindTo.apply(this,n);return this._eventBindings.push(i),i},unbindFrom:function(e){var r=Array.prototype.slice.apply(arguments);n[e.type].unbindFrom.apply(this,r),this._eventBindings=t.reject(this._eventBindings,function(t){return t===e})},unbindAll:function(){var e=t.map(this._eventBindings,t.identity);t.each(e,this.unbindFrom,this)}}),i}(Backbone,_);
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "Backbone.EventBinder",
"description": "Manage your Backbone event bindings better",
- "version": "1.0.1",
+ "version": "1.0.2",
"homepage": "https://github.com/marionettejs/backbone.eventbinder",
"keywords": [
"backbone",
View
7 src/eventbinder.js
@@ -91,7 +91,8 @@ Backbone.EventBinder = (function(Backbone, _){
var obj = arguments[0];
var handlers = getHandlerForObject(obj);
- var binding = handlers.bindTo.apply(this,arguments);
+ var args = Array.prototype.slice.apply(arguments);
+ var binding = handlers.bindTo.apply(this, args);
this._eventBindings.push(binding);
@@ -101,7 +102,9 @@ Backbone.EventBinder = (function(Backbone, _){
// Unbind from a single binding object. Binding objects are
// returned from the `bindTo` method call.
unbindFrom: function(binding) {
- handlerMap[binding.type].unbindFrom.apply(this,arguments);
+ var args = Array.prototype.slice.apply(arguments);
+ handlerMap[binding.type].unbindFrom.apply(this, args);
+
this._eventBindings = _.reject(this._eventBindings, function(bind){return bind === binding;});
},
Please sign in to comment.
Something went wrong with that request. Please try again.