Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

at and getLength to work with mod.js

  • Loading branch information...
commit 754e34a33a43851f5cafedc6aad4537fcd1eabd9 1 parent 6133cb4
@rhysbrettbowen authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 collection.js
View
6 collection.js
@@ -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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.