Permalink
Browse files

at and getLength to work with mod.js

  • Loading branch information...
1 parent 6133cb4 commit 754e34a33a43851f5cafedc6aad4537fcd1eabd9 @rhysbrettbowen committed Jan 10, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 collection.js
View
@@ -185,7 +185,7 @@ mvc.Collection.prototype.getFiltered = function(fn) {
* @return {number} the number of models in the collection.
*/
mvc.Collection.prototype.getLength = function() {
- return this.models_.length;
+ return this.getModels().length;
};
@@ -406,7 +406,9 @@ mvc.Collection.prototype.setModels = function(arr, opt_silent) {
*/
mvc.Collection.prototype.at = function(index) {
try {
- return this.models_[index < 0 ? this.models_.length + index : index].model;
+ return this.getModels()[index < 0 ?
+ this.getModels().length + index :
+ index];
} catch (err) {
return null;
}

0 comments on commit 754e34a

Please sign in to comment.