Skip to content

Instantly share code, notes, and snippets.

@ddavison
Created July 17, 2017 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddavison/326678d59a201c0f28f6d81a3c4def02 to your computer and use it in GitHub Desktop.
Save ddavison/326678d59a201c0f28f6d81a3c4def02 to your computer and use it in GitHub Desktop.
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$(document).ready ->
$('#btn-submit-bundle').click (e) ->
e.preventDefault()
vals = []
$("select[name^='component_bundle'].select2-package").toArray().forEach((e) -> vals.append(e.value))
if vals.length < 1
portal.showDialog("Errors", "Please select at least one component to put inside this bundle.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment