 
 
     $('.printer-list').on 'click', '.set-printer', ->
-      console.log(this.textContent)
       $('#print_printer').val this.textContent
       $('#print_printer').trigger 'chosen:updated'
       $('#print_printer').trigger 'change'

# 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/

$ ->
  if $('#print_printer').length
    $('#print_printer').chosen
      no_results_text: 'No matches'

    $('#print_printer').on 'change', ->
      selected = $ 'option:selected', this
      setMedia selected.data('media').split(' ')
      printer_name = selected["0"].textContent
      localStorage.setItem(printer_local_storage_key, printer_name)

    setMedia $('#print_printer option:selected').data('media').split(' ')

