Permalink
Browse files

Only swap nodes if two indecies is given

  • Loading branch information...
Inviz committed Apr 11, 2012
1 parent 36b82bc commit 8bbbad14c48304948034e81f46e87c743819ac05
Showing with 3 additions and 2 deletions.
  1. +3 −2 Source/DOM/NodeList.js
View
@@ -52,6 +52,7 @@ LSD.NodeList.prototype._observeIndex = function(value, index, state, old) {
if (old == null) value[state ? 'watch' : 'unwatch'](this._sortBy, this)
return value;
};
-LSD.NodeList.prototype.fn = function(collection, value, old) {
- collection.move(collection.indexOf(this), collection.indexFor(this));
+LSD.NodeList.prototype.fn = function(collection, key, value, old) {
+ if (value != null && old != null)
+ collection.move(collection.indexOf(this), collection.indexFor(this));
};

0 comments on commit 8bbbad1

Please sign in to comment.