|
|
|
|
@ -2,23 +2,55 @@
|
|
|
|
|
//stuff goes here
|
|
|
|
|
})(Drupal); |
|
|
|
|
|
|
|
|
|
(function ($) { |
|
|
|
|
|
|
|
|
|
(function (Drupal) { |
|
|
|
|
Drupal.behaviors.LangSwitchBehavior = { |
|
|
|
|
attach: function (context, settings) { |
|
|
|
|
$("#text-fr").hide(); |
|
|
|
|
const textEn = context.querySelector('#text-en'); |
|
|
|
|
const textFr = context.querySelector('#text-fr'); |
|
|
|
|
const showEn = context.querySelector('#show-text-en'); |
|
|
|
|
const showFr = context.querySelector('#show-text-fr'); |
|
|
|
|
|
|
|
|
|
// Hide French text initially
|
|
|
|
|
if (textFr) { |
|
|
|
|
textFr.style.display = 'none'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$( "#show-text-en" , context).click(function(e) { |
|
|
|
|
if (showEn && textEn && textFr) { |
|
|
|
|
showEn.addEventListener('click', function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$("#text-en").show(); |
|
|
|
|
$("#text-fr").hide(); |
|
|
|
|
textEn.style.display = ''; |
|
|
|
|
textFr.style.display = 'none'; |
|
|
|
|
}); |
|
|
|
|
$( "#show-text-fr" , context).click(function(e) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (showFr && textEn && textFr) { |
|
|
|
|
showFr.addEventListener('click', function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$("#text-en").hide(); |
|
|
|
|
$("#text-fr").show(); |
|
|
|
|
textEn.style.display = 'none'; |
|
|
|
|
textFr.style.display = ''; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
})(Drupal); |
|
|
|
|
//(function ($) {
|
|
|
|
|
|
|
|
|
|
//Drupal.behaviors.LangSwitchBehavior = {
|
|
|
|
|
//attach: function (context, settings) {
|
|
|
|
|
//$("#text-fr").hide();
|
|
|
|
|
|
|
|
|
|
//$( "#show-text-en" , context).click(function(e) {
|
|
|
|
|
//e.preventDefault();
|
|
|
|
|
//$("#text-en").show();
|
|
|
|
|
//$("#text-fr").hide();
|
|
|
|
|
//});
|
|
|
|
|
//$( "#show-text-fr" , context).click(function(e) {
|
|
|
|
|
//e.preventDefault();
|
|
|
|
|
//$("#text-en").hide();
|
|
|
|
|
//$("#text-fr").show();
|
|
|
|
|
//});
|
|
|
|
|
//}
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
|
|
}(jQuery)); |
|
|
|
|
//}(jQuery));
|
|
|
|
|
|