Browse Source

lang switch

master
rdrew 1 day ago
parent
commit
2247939a4d
  1. 20
      js/custom.js
  2. 23
      js/lang_switch.js
  3. 2
      olivesbdh.libraries.yml

20
js/custom.js

@ -1,23 +1,3 @@
(function (Drupal) {
//stuff goes here
})(Drupal);
(function ($) {
Drupal.behaviors.ethnographyBehavior = {
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));

23
js/lang_switch.js

@ -0,0 +1,23 @@
(function (Drupal) {
//stuff goes here
})(Drupal);
(function ($) {
Drupal.behaviors.ethnographyBehavior = {
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));

2
olivesbdh.libraries.yml

@ -69,6 +69,8 @@ book:
css:
theme:
css/components/book.css: {}
js:
js/lang_switch.js: {}
cke-dialog:
version: VERSION

Loading…
Cancel
Save