[Pkg-javascript-commits] [backbone] 06/19: internal _initialize to _reset

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:58:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.1.1
in repository backbone.

commit e0b61034dfa6a65e4d8388127e26268ac55c42dd
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Wed Oct 13 17:25:04 2010 -0400

    internal _initialize to _reset
---
 backbone.js | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/backbone.js b/backbone.js
index 28dd788..eeddab2 100644
--- a/backbone.js
+++ b/backbone.js
@@ -305,7 +305,7 @@
       delete options.comparator;
     }
     this._boundOnModelEvent = _.bind(this._onModelEvent, this);
-    this._initialize();
+    this._reset();
     if (models) this.refresh(models,true);
   };
 
@@ -372,7 +372,7 @@
           return new collection.model(attrs);
         });
       }
-      this._initialize();
+      this._reset();
       this.add(models, {silent: true});
       if (!options.silent) this.trigger('refresh', this);
       return this;
@@ -405,9 +405,8 @@
       return model.save(null, {success : success, error : options.error});
     },
 
-    // Initialize or re-initialize all internal state. Called when the
-    // collection is refreshed.
-    _initialize : function(options) {
+    // Reset all internal state. Called when the collection is refreshed.
+    _reset : function(options) {
       this.length = 0;
       this.models = [];
       this._byId  = {};
@@ -484,7 +483,7 @@
   // Creating a Backbone.View creates its intial element outside of the DOM,
   // if an existing element is not provided...
   Backbone.View = function(options) {
-    this._initialize(options || {});
+    this._reset(options || {});
     if (this.options.el) {
       this.el = this.options.el;
     } else {
@@ -569,7 +568,7 @@
     // Performs the initial configuration of a View with a set of options.
     // Keys with special meaning *(model, collection, id, className)*, are
     // attached directly to the view.
-    _initialize : function(options) {
+    _reset : function(options) {
       if (this.options) options = _.extend({}, this.options, options);
       if (options.model)      this.model      = options.model;
       if (options.collection) this.collection = options.collection;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list