Permalink
Browse files

Fixed bug where all events could be unbound if you try and unbind an …

…expression with no model paths in it
  • Loading branch information...
1 parent c7b9a71 commit 41e9ddb5fd6a3724ce078347971d4e32aa355922 @KoryNunn KoryNunn committed Feb 28, 2014
Showing with 8 additions and 2 deletions.
  1. +8 −2 events.js
View
@@ -277,6 +277,14 @@ module.exports = function(modelGet, gel, PathToken){
}
function debind(path, callback){
+
+ // If you pass no path and no callback
+ // You are trying to debind the entire gedi instance.
+ if(!path && !callback){
+ resetEvents();
+ return;
+ }
+
if(typeof path === 'function'){
callback = path;
path = null;
@@ -293,8 +301,6 @@ module.exports = function(modelGet, gel, PathToken){
while(references.length){
debindExpression(references.pop(), callback);
}
- }else{
- resetEvents();
}
return;
}

0 comments on commit 41e9ddb

Please sign in to comment.