Sha256: 5be6153e1670e26d9945ea5c95b480d6e26e2c4f888e77f237e4759de4135c8d

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

$(document).ready ->
  $("a[rel=popover]").popover()
  $(".tooltip").tooltip()
  $("a[rel=tooltip]").tooltip() 

  $( '.accordions' ).each (k, v) ->
    $(v).accordion({ autoHeight: false });
    
  $('.tabs').each (k, v) ->
    $(v).tabs({ autoHeight: false });
    
  $('form').on 'click', '.remove_fields', (event) ->
    #$(this).prev('input[type=hidden]').val('1')
    $(this).closest('fieldset').remove()
    event.preventDefault()

  $('form').on 'click', '.add_fields', (event) ->
    time = new Date().getTime()
    regexp = new RegExp($(this).data('id'), 'g')
    target = $(this)
    
    if $(this).data('target')
      target = $('#' + $(this).data('target'))
      
    target.before($(this).data('fields').replace(regexp, time))
    event.preventDefault()
  
  $('input[data-autocomplete]').each (k, v) ->
    $(v).autocomplete({
      source: $(this).attr('data-autocomplete'),
      select: (event, ui) ->
        $(this).val(ui.item.value)
        
        if ($(this).attr('id_element'))
          $($(this).attr('id_element')).val(ui.item.id)
        
        return false;
    });
    
  $( ".datepicker" ).each (k, v) ->
    $(v).datepicker({ dateFormat: "yy-mm-dd", changeYear: true, yearRange: "c-100:c+10" });

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voluntary-0.1.0 app/assets/javascripts/voluntary/base.js.coffee
voluntary-0.1.0.rc4 app/assets/javascripts/voluntary/base.js.coffee
voluntary-0.1.0.rc3 app/assets/javascripts/voluntary/base.js.coffee
voluntary-0.1.0.rc2 app/assets/javascripts/voluntary/base.js.coffee
voluntary-0.1.0.rc1 app/assets/javascripts/voluntary/base.js.coffee