Sha256: 3ac0c9bca9a4205380c6f2dccf81ebcb24fbdcaa810fa5eb2fc1397095808d59

Contents?: true

Size: 420 Bytes

Versions: 5

Compression:

Stored size: 420 Bytes

Contents

$(document).on 'click', '.btn.btn-danger.remove-fields', ->
  $('a.add-fields').removeClass 'hidden'

$(document).on 'click', 'a.add-fields', ->
  $collectionContainer = $(@).closest('.file-collection-container')
  maxFiles = $collectionContainer.data('max')
  numberOfFiles = $collectionContainer.find('.product-image:not(.hidden)').length + 1
  if maxFiles != 0 && numberOfFiles > maxFiles
    $(@).addClass('hidden')

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adminpanel-2.4.2 app/assets/javascripts/adminpanel/sections.js.coffee
adminpanel-2.4.1 app/assets/javascripts/adminpanel/sections.js.coffee
adminpanel-2.4.0 app/assets/javascripts/adminpanel/sections.js.coffee
adminpanel-2.3.1 app/assets/javascripts/adminpanel/sections.js.coffee
adminpanel-2.3.0 app/assets/javascripts/adminpanel/sections.js.coffee