Use spaces around curly braces in CoffeeScript

Just like we do in Ruby.
This commit is contained in:
Javi Martín
2019-03-04 13:40:26 +01:00
parent a0976d8bfd
commit d963657e41
5 changed files with 8 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ App.LegislationAnnotatable =
renderAnnotationComments: (event) ->
if event.offset
$("#comments-box").css({top: event.offset - $('.calc-comments').offset().top})
$("#comments-box").css({ top: event.offset - $('.calc-comments').offset().top })
if App.LegislationAnnotatable.isMobile()
return
@@ -105,7 +105,7 @@ App.LegislationAnnotatable =
dataType: 'script').done (->
$('#new_legislation_annotation #legislation_annotation_quote').val(@annotation.quote)
$('#new_legislation_annotation #legislation_annotation_ranges').val(JSON.stringify(@annotation.ranges))
$('#comments-box').css({top: position.top - $('.calc-comments').offset().top})
$('#comments-box').css({ top: position.top - $('.calc-comments').offset().top })
unless $('[data-legislation-open-phase]').data('legislation-open-phase') == false
App.LegislationAnnotatable.highlight('#7fff9a')
@@ -143,7 +143,7 @@ App.LegislationAnnotatable =
el.addClass('current-annotation')
$('#comments-box').html('')
App.LegislationAllegations.show_comments()
$('html,body').animate({scrollTop: el.offset().top})
$('html,body').animate({ scrollTop: el.offset().top })
$.event.trigger
type: "renderLegislationAnnotation"
annotation_id: ann_id

View File

@@ -2,8 +2,8 @@ App.Sortable =
initialize: ->
$(".sortable").sortable
update: (event, ui) ->
new_order = $(this).sortable('toArray', {attribute: 'data-answer-id'});
new_order = $(this).sortable('toArray', { attribute: 'data-answer-id' });
$.ajax
url: $('.sortable').data('js-url'),
data: {ordered_list: new_order},
data: { ordered_list: new_order },
type: 'POST'

View File

@@ -3,7 +3,7 @@
buildGraph = (el) ->
url = $(el).data 'graph'
conf = bindto: el, data: {x: 'x', url: url, mimeType: 'json'}, axis: { x: {type: 'timeseries',tick: { format: '%Y-%m-%d' } }}
conf = bindto: el, data: { x: 'x', url: url, mimeType: 'json' }, axis: { x: { type: 'timeseries',tick: { format: '%Y-%m-%d' } } }
graph = c3.generate conf
App.Stats =

View File

@@ -9,7 +9,7 @@ App.Suggest =
callback = ->
$.ajax
url: $this.data('js-url')
data: {search: $this.val()},
data: { search: $this.val() },
type: 'GET',
dataType: 'html'
success: (stHtml) ->

View File

@@ -11,7 +11,7 @@ App.TagAutocomplete =
source: (request, response) ->
$.ajax
url: $('.tag-autocomplete').data('js-url'),
data: {search: App.TagAutocomplete.extractLast( request.term )},
data: { search: App.TagAutocomplete.extractLast( request.term ) },
type: 'GET',
dataType: 'json'
success: ( data ) ->