Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: vitorbal/backbone-fundamentals
base: 023bb63e97
...
head fork: vitorbal/backbone-fundamentals
compare: 0700e9dd17
  • 9 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 04, 2012
Addy Osmani addyosmani Merge pull request #94 from vitorbal/master
Add link for 'Large Scale Applications with jQuery' to 'Additional Tips' section
d7a2f01
Commits on Apr 06, 2012
Addy Osmani addyosmani Merge pull request #95 from vitorbal/master
Update Collection.reset() section to explain that a reset event is fired instead of multiple add/remove events
60cffaa
Kim Joar Bekkelund kjbekkelund Use cached version of the el jQuery object 8c007bc
Addy Osmani addyosmani Merge pull request #97 from vitorbal/master
Fix searchPhotos handler on GalleryRouter example
507c7d4
Addy Osmani addyosmani Merge pull request #98 from kjbekkelund/idiomatic-el
Use cached version of the el jQuery object
8943458
Kim Joar Bekkelund kjbekkelund Add missing '.' for jQuery lookup ee11527
Addy Osmani addyosmani Merge pull request #99 from kjbekkelund/class-bug
Add missing '.' for jQuery lookup
4a50a80
Commits on Apr 07, 2012
Kim Joar Bekkelund kjbekkelund Spelling: callows -> allows 60a5cf8
Addy Osmani addyosmani Merge pull request #101 from kjbekkelund/spelling
Spelling: callows -> allows
0700e9d
Showing with 13 additions and 13 deletions.
  1. +13 −13 index.md
26 index.md
View
@@ -332,7 +332,7 @@ var PhotosController = Spine.Controller.sub({
},
remove: function(){
- this.el.remove();
+ this.$el.remove();
this.release();
}
});
@@ -474,7 +474,7 @@ var PhotoView = Backbone.View.extend({
// Re-render the photo entry
render: function() {
- $(this.el).html(this.template(this.model.toJSON()));
+ this.$el.html(this.template(this.model.toJSON()));
return this;
},
@@ -755,7 +755,7 @@ var PhotoSearch = Backbone.View.extend({
el: $('#results'),
render: function( event ){
var compiled_template = _.template( $("#results-template").html() );
- this.el.html( compiled_template(this.model.toJSON()) );
+ this.$el.html( compiled_template(this.model.toJSON()) );
return this; //recommended as this enables calls to be chained.
},
events: {
@@ -2685,7 +2685,7 @@ require(['js/app', 'text!templates/mainView.html'],
That's it!. You can then go applying your template to a view in Backbone doing something like:
```javascript
-collection.someview.el.html( compiled_template( { results: collection.models } ) );
+collection.someview.$el.html( compiled_template( { results: collection.models } ) );
```
@@ -2959,7 +2959,7 @@ define([
// Re-render the contents of the todo item.
render: function() {
- $(this.el).html(this.template(this.model.toJSON()));
+ this.$el.html(this.template(this.model.toJSON()));
this.setContent();
return this;
},
@@ -3376,7 +3376,7 @@ function ($, _, facade) {
context.model.save({
content: context.input.val()
});
- $(context.el).removeClass("editing");
+ context.$el.removeClass("editing");
} catch (e) {
//console.log(e);
}
@@ -3412,7 +3412,7 @@ function ($, _, facade) {
// Update editing UI on switching mode to editing content
// Subscribes to: beginContentEditing
facade.subscribe('editFocus','beginContentEditing', function (context) {
- $(context.el).addClass("editing");
+ context.$el.addClass("editing");
context.input.focus();
});
@@ -4602,7 +4602,7 @@ If instead of testing against the ```tagName``` you would prefer to use a classN
```
it('Should have a class of "todos"'), function(){
- expect($(this.view.el)).toHaveClass('todos');
+ expect(this.view.$el).toHaveClass('todos');
});
```
@@ -4694,7 +4694,7 @@ render: function() {
var template = '<label class="todo-content"><%= text %></label>';
var output = template
.replace("<%= text %>", this.model.get('text'));
- $(this.el).html(output);
+ this.$el.html(output);
return this;
}
```
@@ -4712,7 +4712,7 @@ describe("Template", function() {
});
it("has the correct text content", function() {
- expect($(this.view.el).find('todo-content'))
+ expect(this.view.$('.todo-content'))
.toHaveText('My Todo');
});
@@ -4792,7 +4792,7 @@ render: function() {
'<%= text %></label>';
var output = template
.replace("<%= text %>", this.model.get('text'));
- $(this.el).html(output);
+ this.$el.html(output);
if (this.model.get('done')) {
this.$(".todo-content").addClass("done");
}
@@ -4815,7 +4815,7 @@ var TodoView = Backbone.View.extend({
},
render: function() {
- $(this.el).html(this.template(this.model.toJSON()));
+ this.$el.html(this.template(this.model.toJSON()));
return this;
},
@@ -5383,7 +5383,7 @@ test( "should inspect jQuery.getJSON's usage of jQuery.ajax", function () {
});
```
-SinonJS comes with a rich spy interface which callows us to test whether a spy was called with a specific argument, if it was called a specific number of times and test against the values of arguments. A complete list of features supported in the interface can be found here (http://sinonjs.org/docs/), but let's take a look at some examples demonstrating some of the most commonly used ones:
+SinonJS comes with a rich spy interface which allows us to test whether a spy was called with a specific argument, if it was called a specific number of times and test against the values of arguments. A complete list of features supported in the interface can be found here (http://sinonjs.org/docs/), but let's take a look at some examples demonstrating some of the most commonly used ones:
####Matching arguments: test a spy was called with a specific set of arguments:

No commit comments for this range

Something went wrong with that request. Please try again.