Sha256: 33918cd182ee34689f1162278b0341c98949a650bece45e549b667b9c7bd88b7

Contents?: true

Size: 1.6 KB

Versions: 37

Compression:

Stored size: 1.6 KB

Contents

// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

$(document).ready(function(){

  $('.datepicker').datepicker({"format": "dd/mm/yyyy", "weekStart": 1, "autoclose": true});

  $('.language_to').click(function(){
    var language_to = $.trim($(this).attr('lang_sym'));
    $.ajax({
      type: 'POST',
      url: Routes.translation_center_set_lang_to_path,
      data: { lang : language_to },
      success: function(){
        location.reload();
      }
    });
  });

  $('.language_from').click(function(){
    var language_from = $.trim($(this).attr('lang_sym'));
    $.ajax({
      type: 'POST',
      url: Routes.translation_center_set_lang_from_path,
      data: { lang : language_from },
      success: function(){
        location.reload();
      }
    });
  });

  $('#search_activity').click(function(){
    $.ajax({
      type: 'GET',
      url: Routes.translation_center_search_activity_path + '.js',
      data: $('#search_form').serialize()
    });
    return false;
  });

  $('#search_reset').click(function(){
    $('#search_form').children('input').each(function(){
      $(this).val('')  
    })
    $('#search_form').children('select').val('');
    $('#search_activity').click();
  });

  $(document).on('click', '.pagination a', function(){
    $.ajax({
      type: "GET",
      url: $(this).attr("href"),
      dataType: "script"
    });
    return false;
  });

  $("body").on({
    ajaxStart: function() { 
      $('#loading').show();
    },
    ajaxStop: function() { 
      $('#loading').hide();
    }    
  });

});

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
translation_center-1.6.7 app/assets/javascripts/translation_center/center.js
translation_center-1.6.6 app/assets/javascripts/translation_center/center.js
translation_center-1.6.5 app/assets/javascripts/translation_center/center.js
translation_center-1.6.4 app/assets/javascripts/translation_center/center.js
translation_center-1.6.3 app/assets/javascripts/translation_center/center.js
translation_center-1.6.2 app/assets/javascripts/translation_center/center.js
translation_center-1.6.1 app/assets/javascripts/translation_center/center.js
translation_center-1.6.0 app/assets/javascripts/translation_center/center.js
translation_center-1.5.9 app/assets/javascripts/translation_center/center.js
translation_center-1.5.8 app/assets/javascripts/translation_center/center.js
translation_center-1.5.7 app/assets/javascripts/translation_center/center.js
translation_center-1.5.6 app/assets/javascripts/translation_center/center.js
translation_center-1.5.5 app/assets/javascripts/translation_center/center.js
translation_center-1.5.4 app/assets/javascripts/translation_center/center.js
translation_center-1.5.3 app/assets/javascripts/translation_center/center.js
translation_center-1.5.2 app/assets/javascripts/translation_center/center.js
translation_center-1.5.1 app/assets/javascripts/translation_center/center.js
translation_center-1.5.0 app/assets/javascripts/translation_center/center.js
translation_center-1.4.1 app/assets/javascripts/translation_center/center.js
translation_center-1.4.0 app/assets/javascripts/translation_center/center.js