Skip to content

Commit

Permalink
Add js code needed in the product images page
Browse files Browse the repository at this point in the history
  • Loading branch information
luisramos0 committed Jan 30, 2020
1 parent c20a411 commit 9a52a12
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/assets/javascripts/admin/spree/images/index.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$ ->
($ '#new_image_link').click (event) ->
event.preventDefault()

($ '.no-objects-found').hide()

($ this).hide()
$.ajax
type: 'GET'
url: @href
data: (
authenticity_token: AUTH_TOKEN
)
success: (r) ->
($ '#images').html r
7 changes: 7 additions & 0 deletions app/assets/javascripts/admin/spree/images/new.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
($ '#cancel_link').click (event) ->
event.preventDefault()

($ '.no-objects-found').show()

($ '#new_image_link').show()
($ '#images').html('')

0 comments on commit 9a52a12

Please sign in to comment.