Skip to content

Commit

Permalink
Fix coffeescript code styles
Browse files Browse the repository at this point in the history
* Remove semicolons
* Fix indentation
* Remove backticks
  • Loading branch information
vfonic committed Feb 19, 2017
1 parent 4cfd1a2 commit 08f1e12
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ onDeleteLineItem = (e) ->
e.preventDefault()
return unless confirm(Spree.translations.are_you_sure_delete)
line_item = $(this).closest('.line-item')
line_item_id = line_item.data('line-item-id');
line_item_id = line_item.data('line-item-id')
deleteLineItem(line_item_id)
editingDone(e)

Expand Down
18 changes: 9 additions & 9 deletions backend/app/assets/javascripts/spree/backend/taxonomy.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ get_create_handler = (taxonomy_id) ->
setup_taxonomy_tree = (taxonomy_id) ->
redraw_tree()
$("#taxonomy_tree").on
sortstart: (e, ui) ->
resize_placeholder(ui)
sortover: (e, ui) ->
highlight_sort_targets(ui)
sortstop: restore_sort_targets
sortupdate: (e, ui) ->
handle_move(ui.item) unless ui.sender?
.on('click', '.js-taxon-delete', handle_delete)
.on('click', '.js-taxon-add-child', handle_add_child)
sortstart: (e, ui) ->
resize_placeholder(ui)
sortover: (e, ui) ->
highlight_sort_targets(ui)
sortstop: restore_sort_targets
sortupdate: (e, ui) ->
handle_move(ui.item) unless ui.sender?
.on('click', '.js-taxon-delete', handle_delete)
.on('click', '.js-taxon-add-child', handle_add_child)
$('.add-taxon-button').on('click', get_create_handler(taxonomy_id))

$ ->
Expand Down
14 changes: 7 additions & 7 deletions backend/app/assets/javascripts/spree/backend/taxons.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ $ ->
lowerDraggable $(e.currentTarget)

saveSort = (event, ui) ->
Spree.ajax
url: Spree.routes.classifications_api,
method: 'PUT',
data:
product_id: ui.item.data('product-id'),
taxon_id: $('#taxon_id').val(),
position: ui.item.index()
Spree.ajax
url: Spree.routes.classifications_api,
method: 'PUT',
data:
product_id: ui.item.data('product-id'),
taxon_id: $('#taxon_id').val(),
position: ui.item.index()

sortable = $('#taxon_products').sortable()
.on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
variantTemplate = HandlebarsTemplates["variants/autocomplete"]

formatVariantResult = (variant) ->
variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
variant.image = variant.images[0].mini_url if variant["images"][0] isnt undefined and variant["images"][0].mini_url isnt undefined
variantTemplate variant: variant

$.fn.variantAutocomplete = (searchOptions = {}) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Spree.onCouponCodeApply = (e) ->
}
)

couponStatus.removeClass([successClass,errorClass].join(" "));
couponStatus.removeClass([successClass,errorClass].join(" "))

req = Spree.ajax
method: "PUT",
url: url

req.done (data) ->
window.location.reload();
window.location.reload()
couponCodeField.val('')
couponStatus.addClass(successClass).html("Coupon code applied successfully.")

Expand Down

0 comments on commit 08f1e12

Please sign in to comment.