Permalink
Browse files

Merge pull request #132 from mkelley33/el-cached

Replace el selectors with cached el usage
  • Loading branch information...
2 parents a4f89d7 + 3898971 commit 084bb87a93f332d96bce583609b6513fbd2b590b Ryan Fitzgerald committed Nov 21, 2012
@@ -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
@@ -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)
@@ -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
@@ -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
@@ -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)
@@ -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
@@ -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)
@@ -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
@@ -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)
@@ -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
@@ -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

0 comments on commit 084bb87

Please sign in to comment.