You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

boulange.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. $(document).ready(function()
  7. {
  8. boulange_signup() ;
  9. boulange_add_boulangerie() ;
  10. });
  11. function boulange_scroll(id) {
  12. if($("#"+id).size())
  13. $('html,body').animate({
  14. scrollTop: $("#"+id).offset().top},
  15. 1000);
  16. }
  17. function boulange_add_boulangerie()
  18. {
  19. $('#bloc-add-etablissement .panel-heading').click(function() {
  20. var panel_body = $(this).parent().find('.panel-body') ;
  21. if(panel_body.css('display') == 'none')
  22. panel_body.fadeIn() ;
  23. else
  24. panel_body.hide() ;
  25. }) ;
  26. $('#addetablissementform-id_etablissement,#signupform-id_etablissement').change(function() {
  27. if($(this).find('option:selected').hasClass('lock')) {
  28. $('#bloc-code-acces').fadeIn() ;
  29. }
  30. else {
  31. $('#bloc-code-acces').hide() ;
  32. }
  33. }) ;
  34. if($('#addetablissementform-id_etablissement option:selected,#signupform-id_etablissement option:selected').hasClass('lock')) {
  35. $('#bloc-code-acces').show() ;
  36. }
  37. else {
  38. $('#bloc-code-acces').hide() ;
  39. }
  40. if($('#bloc-add-etablissement').size()) {
  41. if($('#bloc-add-etablissement .has-error').size()) {
  42. $('#bloc-add-etablissement .panel-body').show() ;
  43. }
  44. }
  45. }
  46. function boulange_signup()
  47. {
  48. if($('#form-signup').size())
  49. {
  50. boulange_signup_champs_boulanger() ;
  51. $('#option-client, #option-boulanger').change(function() {
  52. boulange_signup_champs_boulanger() ;
  53. }) ;
  54. }
  55. }
  56. function boulange_signup_champs_boulanger()
  57. {
  58. if($('#option-boulanger').prop('checked'))
  59. {
  60. $('#champs-boulanger').fadeIn() ;
  61. $('#champs-client').hide() ;
  62. }
  63. else {
  64. $('#champs-boulanger').hide() ;
  65. $('#champs-client').fadeIn() ;
  66. }
  67. }