diff --git a/js/custom.js b/js/custom.js index 233d291..d6bfbee 100644 --- a/js/custom.js +++ b/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)); diff --git a/js/lang_switch.js b/js/lang_switch.js new file mode 100644 index 0000000..233d291 --- /dev/null +++ b/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)); diff --git a/olivesbdh.libraries.yml b/olivesbdh.libraries.yml index 27f48fd..b574af8 100755 --- a/olivesbdh.libraries.yml +++ b/olivesbdh.libraries.yml @@ -69,6 +69,8 @@ book: css: theme: css/components/book.css: {} + js: + js/lang_switch.js: {} cke-dialog: version: VERSION