reha.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /**
  2. * @file
  3. * reha behaviors.
  4. */
  5. (function (Drupal) {
  6. 'use strict';
  7. Drupal.behaviors.reha = {
  8. attach: function (context, settings) {
  9. console.log('It works!');
  10. }
  11. };
  12. } (Drupal));
  13. jQuery(document).ready(function($){
  14. // menu déroulant
  15. ////////////// contacts ///////
  16. $(".bouton-contact").click(function(event) {
  17. // Fermer .connexion-full s'il est déroulé
  18. if ($(".connexion-full").is(":visible")) {
  19. $(".connexion-full").slideUp();
  20. }
  21. if ($(".connected-full").is(":visible")) {
  22. $(".connected-full").slideUp();
  23. }
  24. // Ouvrir .contacts-full
  25. $(".contacts-full").slideToggle();
  26. });
  27. ////////////// connexion ///////
  28. $(".bouton-connexion").click(function(event) {
  29. // Fermer .contacts-full s'il est déroulé
  30. if ($(".contacts-full").is(":visible")) {
  31. $(".contacts-full").slideUp();
  32. }
  33. // Ouvrir .connexion-full
  34. $(".connexion-full").slideToggle();
  35. });
  36. $(".bouton-connected").click(function(event) {
  37. // Fermer .contacts-full s'il est déroulé
  38. if ($(".contacts-full").is(":visible")) {
  39. $(".contacts-full").slideUp();
  40. }
  41. // Ouvrir .connected-full
  42. $(".connected-full").slideToggle();
  43. });
  44. $(".titre").click(function(event) {
  45. if ($(".connected-full").is(":visible")) {
  46. $(".connected-full").slideUp();
  47. }
  48. if ($(".contacts-full").is(":visible")) {
  49. $(".contacts-full").slideUp();
  50. }
  51. if ($(".connexion-full").is(":visible")) {
  52. $(".connexion-full").slideUp();
  53. }
  54. // // Ouvrir .connexion-full
  55. // $(".connected-full").slideToggle();
  56. });
  57. $("#edit-field-dossier-de-candidature-0--label").click(function(event) {
  58. event.preventDefault();
  59. // Ouvrir .connexion-full
  60. $("#edit-field-dossier-de-candidature-0--description>ul.main").slideToggle();
  61. });
  62. ////////////// tiroir fichiers ///////
  63. $(".profile--type--collaborateur").click(function(event) {
  64. // Ouvrir .tiroir fichiers
  65. $(".layout-sidebar-second").animate({translate:'90%'},350);
  66. });
  67. $("#block-reha-views-block-current-user-doc-profile-block-1 > h2").click(function(event) {
  68. // Ouvrir .tiroir fichiers
  69. $(".layout-sidebar-second").animate({translate:'0%'},350);
  70. });
  71. });
  72. // slideshow home
  73. (function($, window) {
  74. console.log('hello slick')
  75. $(document).ready(function(){
  76. $('.view-id-sites.view-display-id-block_1').slick({
  77. slidesToShow: 1,
  78. // slidesToScroll: 1,
  79. dots: false,
  80. arrows: true,
  81. centerMode: true,
  82. adaptiveHeight: true,
  83. // centerPadding: '100px',
  84. responsive: [
  85. {
  86. breakpoint: 810,
  87. settings: {
  88. slidesToShow: 1,
  89. adaptiveHeight: true,
  90. arrows: false,
  91. draggable: true,
  92. centerMode: true,
  93. }
  94. }]
  95. });
  96. console.log('salut slick home');
  97. });
  98. $(document).ready(function(){
  99. $('.view-id-actus.view-display-id-block_1').slick({
  100. slidesToShow: 3,
  101. // slidesToScroll: 1,
  102. dots: false,
  103. arrows: true,
  104. centerMode: true,
  105. // centerPadding: '100px',
  106. responsive: [
  107. {
  108. breakpoint: 810,
  109. settings: {
  110. slidesToShow: 1,
  111. adaptiveHeight: true,
  112. arrows: false,
  113. draggable: true,
  114. centerMode: true,
  115. }
  116. }]
  117. });
  118. console.log('slick actu');
  119. });
  120. $(document).ready(function(){
  121. $('.page-node-site .node-type-site .field--name-field-image > div:nth-child(2)').slick({
  122. slidesToShow: 1,
  123. slidesToScroll: 1,
  124. dots: true,
  125. arrows: false,
  126. adaptiveHeight: true,
  127. // centerMode: true,
  128. // centerPadding: '100px',
  129. responsive: [
  130. {
  131. breakpoint: 810,
  132. settings: {
  133. slidesToShow: 1,
  134. adaptiveHeight: true,
  135. arrows: false,
  136. draggable: true,
  137. centerMode: true,
  138. }
  139. }]
  140. });
  141. console.log('slick actu');
  142. });
  143. })(jQuery, window);