Use this instead of @ in CoffeeScript

We're using `this` most of the time, and it's what's used in JavaScript.
This commit is contained in:
Javi Martín
2019-06-30 19:12:22 +02:00
parent aa458b8c87
commit 747767386a
4 changed files with 9 additions and 9 deletions

View File

@@ -17,9 +17,9 @@ App.Documentable =
initializeDirectUploadInput: (input) ->
inputData = @buildData([], input)
inputData = this.buildData([], input)
@initializeRemoveCachedDocumentLink(input, inputData)
this.initializeRemoveCachedDocumentLink(input, inputData)
$(input).fileupload

View File

@@ -18,9 +18,9 @@ App.Imageable =
initializeDirectUploadInput: (input) ->
inputData = @buildData([], input)
inputData = this.buildData([], input)
@initializeRemoveCachedImageLink(input, inputData)
this.initializeRemoveCachedImageLink(input, inputData)
$(input).fileupload

View File

@@ -85,7 +85,7 @@ App.LegislationAnnotatable =
return
customShow: (position) ->
$(@element).html ""
$(this.element).html ""
# Clean comments section and open it
$("#comments-box").html ""
App.LegislationAllegations.show_comments()
@@ -96,8 +96,8 @@ App.LegislationAnnotatable =
method: "GET"
url: "#{annotation_url}/annotations/new"
dataType: "script").done (->
$("#new_legislation_annotation #legislation_annotation_quote").val(@annotation.quote)
$("#new_legislation_annotation #legislation_annotation_ranges").val(JSON.stringify(@annotation.ranges))
$("#new_legislation_annotation #legislation_annotation_quote").val(this.annotation.quote)
$("#new_legislation_annotation #legislation_annotation_ranges").val(JSON.stringify(this.annotation.ranges))
$("#comments-box").css({ top: position.top - $(".calc-comments").offset().top })
unless $("[data-legislation-open-phase]").data("legislation-open-phase") == false

View File

@@ -12,9 +12,9 @@ App.TableSortable =
$("table.sortable th").click ->
table = $(this).parents("table").eq(0)
rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index()))
@asc = !@asc
this.asc = !this.asc
if @asc
if this.asc
table.append rows
else
table.append rows.reverse()