reha.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. $(document).ready(function() {
  72. // Vérifier l'état initial depuis sessionStorage
  73. if (sessionStorage.getItem('asideOpened') === 'true') {
  74. $(".layout-sidebar-second").addClass('open');
  75. }
  76. $(".profile--type--collaborateur").click(function(event) {
  77. // Ouvrir .tiroir fichiers
  78. $(".layout-sidebar-second").addClass('open');
  79. sessionStorage.setItem('asideOpened', 'true');
  80. });
  81. $("#block-reha-views-block-current-user-doc-profile-block-1 > h2").click(function(event) {
  82. // Fermer .tiroir fichiers
  83. $(".layout-sidebar-second").removeClass('open');
  84. sessionStorage.setItem('asideOpened', 'false');
  85. });
  86. });
  87. });
  88. // slideshow home
  89. (function($, window) {
  90. console.log('hello slick')
  91. $(document).ready(function(){
  92. $('.view-id-sites.view-display-id-block_1').slick({
  93. slidesToShow: 1,
  94. // slidesToScroll: 1,
  95. dots: false,
  96. arrows: true,
  97. centerMode: true,
  98. adaptiveHeight: true,
  99. // centerPadding: '100px',
  100. responsive: [
  101. {
  102. breakpoint: 810,
  103. settings: {
  104. slidesToShow: 1,
  105. adaptiveHeight: true,
  106. arrows: false,
  107. draggable: true,
  108. centerMode: true,
  109. }
  110. }]
  111. });
  112. console.log('salut slick home');
  113. });
  114. $(document).ready(function(){
  115. $('.view-id-actus.view-display-id-block_1').slick({
  116. slidesToShow: 3,
  117. // slidesToScroll: 1,
  118. dots: false,
  119. arrows: true,
  120. centerMode: true,
  121. // centerPadding: '100px',
  122. responsive: [
  123. {
  124. breakpoint: 810,
  125. settings: {
  126. slidesToShow: 1,
  127. adaptiveHeight: true,
  128. arrows: false,
  129. draggable: true,
  130. centerMode: true,
  131. }
  132. }]
  133. });
  134. console.log('slick actu');
  135. });
  136. $(document).ready(function(){
  137. $('.page-node-site .node-type-site .field--name-field-image > div:nth-child(2)').slick({
  138. slidesToShow: 1,
  139. slidesToScroll: 1,
  140. dots: true,
  141. arrows: false,
  142. adaptiveHeight: true,
  143. // centerMode: true,
  144. // centerPadding: '100px',
  145. responsive: [
  146. {
  147. breakpoint: 810,
  148. settings: {
  149. slidesToShow: 1,
  150. adaptiveHeight: true,
  151. arrows: false,
  152. draggable: true,
  153. centerMode: true,
  154. }
  155. }]
  156. });
  157. console.log('slick actu');
  158. });
  159. })(jQuery, window);