Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Replace el selectors with cached el usage #132

Merged
merged 1 commit into from

3 participants

@mkelley33

Changes for issue #131

(cherry picked from commit bfedb50)

@mkelley33

I didn't mean to duplicate issue #131 that I submitted. I apologize for any confusion or inconvenience. This issue is simply the pull request with code attached. Cheers!

@nilbus

I like this

@ryanfitz ryanfitz merged commit 084bb87 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 8, 2012
  1. @mkelley33

    Replace el selectors with cached el usage

    mkelley33 authored
    (cherry picked from commit bfedb50)
This page is out of date. Refresh to see the latest.
View
2  lib/generators/backbone/router/templates/view.coffee
@@ -4,5 +4,5 @@ class <%= view_namespace %>.<%= @action.camelize %>View extends Backbone.View
template: JST["<%= jst @action %>"]
render: ->
- $(@el).html(@template())
+ @$el.html(@template())
return this
View
2  lib/generators/backbone/scaffold/templates/views/edit_view.coffee
@@ -17,7 +17,7 @@ class <%= view_namespace %>.EditView extends Backbone.View
)
render : ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
this.$("form").backboneLink(@model)
View
2  lib/generators/backbone/scaffold/templates/views/index_view.coffee
@@ -14,7 +14,7 @@ class <%= view_namespace %>.IndexView extends Backbone.View
@$("tbody").append(view.render().el)
render: =>
- $(@el).html(@template(<%= plural_model_name %>: @options.<%= plural_model_name %>.toJSON() ))
+ @$el.html(@template(<%= plural_model_name %>: @options.<%= plural_model_name %>.toJSON() ))
@addAll()
return this
View
2  lib/generators/backbone/scaffold/templates/views/model_view.coffee
@@ -15,5 +15,5 @@ class <%= view_namespace %>.<%= singular_name.camelize %>View extends Backbone.V
return false
render: ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
return this
View
2  lib/generators/backbone/scaffold/templates/views/new_view.coffee
@@ -30,7 +30,7 @@ class <%= view_namespace %>.NewView extends Backbone.View
)
render: ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
this.$("form").backboneLink(@model)
View
2  lib/generators/backbone/scaffold/templates/views/show_view.coffee
@@ -4,5 +4,5 @@ class <%= view_namespace %>.ShowView extends Backbone.View
template: JST["<%= jst 'show' %>"]
render: ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
return this
View
2  test/dummy/app/assets/javascripts/backbone/views/posts/edit_view.js.coffee
@@ -17,7 +17,7 @@ class Dummy.Views.Posts.EditView extends Backbone.View
)
render : ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
this.$("form").backboneLink(@model)
View
2  test/dummy/app/assets/javascripts/backbone/views/posts/index_view.js.coffee
@@ -14,7 +14,7 @@ class Dummy.Views.Posts.IndexView extends Backbone.View
@$("tbody").append(view.render().el)
render: =>
- $(@el).html(@template(posts: @options.posts.toJSON() ))
+ @$el.html(@template(posts: @options.posts.toJSON() ))
@addAll()
return this
View
2  test/dummy/app/assets/javascripts/backbone/views/posts/new_view.js.coffee
@@ -30,7 +30,7 @@ class Dummy.Views.Posts.NewView extends Backbone.View
)
render: ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
this.$("form").backboneLink(@model)
View
2  test/dummy/app/assets/javascripts/backbone/views/posts/post_view.js.coffee
@@ -15,5 +15,5 @@ class Dummy.Views.Posts.PostView extends Backbone.View
return false
render: ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
return this
View
2  test/dummy/app/assets/javascripts/backbone/views/posts/show_view.js.coffee
@@ -4,5 +4,5 @@ class Dummy.Views.Posts.ShowView extends Backbone.View
template: JST["backbone/templates/posts/show"]
render: ->
- $(@el).html(@template(@model.toJSON() ))
+ @$el.html(@template(@model.toJSON() ))
return this
Something went wrong with that request. Please try again.