From 3b6864835df80a90e93ad4dfd9cb296f414d4fd0 Mon Sep 17 00:00:00 2001 From: Asan Usipov Date: Thu, 4 Aug 2011 21:25:43 +0400 Subject: [PATCH] Added 'groupBy' to underscore proxy methods --- backbone.js | 2 +- index.html | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backbone.js b/backbone.js index df6f538e..69ea96dc 100644 --- a/backbone.js +++ b/backbone.js @@ -641,7 +641,7 @@ var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', 'detect', 'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size', - 'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty']; + 'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty', 'groupBy']; // Mix in each Underscore method as a proxy to `Collection#models`. _.each(methods, function(method) { diff --git a/index.html b/index.html index 1b72816b..2c5e6333 100644 --- a/index.html +++ b/index.html @@ -207,7 +207,7 @@
  • constructor / initialize
  • models
  • toJSON
  • -
  • Underscore Methods (25)
  • +
  • Underscore Methods (26)
  • add
  • remove
  • get
  • @@ -1113,9 +1113,9 @@ alert(JSON.stringify(collection));

    - Underscore Methods (25) + Underscore Methods (26)
    - Backbone proxies to Underscore.js to provide 25 iteration functions + Backbone proxies to Underscore.js to provide 26 iteration functions on Backbone.Collection. They aren't all documented here, but you can take a look at the Underscore documentation for the full details…

    @@ -1135,6 +1135,7 @@ alert(JSON.stringify(collection));
  • max
  • min
  • sortBy
  • +
  • groupBy
  • sortedIndex
  • toArray
  • size