X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmisc%2Fdrupal.init.es6.js;fp=web%2Fcore%2Fmisc%2Fdrupal.init.es6.js;h=62cd029e46aa4a936a2c56066974a1d9a0f8c1ee;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/misc/drupal.init.es6.js b/web/core/misc/drupal.init.es6.js new file mode 100644 index 000000000..62cd029e4 --- /dev/null +++ b/web/core/misc/drupal.init.es6.js @@ -0,0 +1,17 @@ +// Allow other JavaScript libraries to use $. +if (window.jQuery) { + jQuery.noConflict(); +} + +// Class indicating that JS is enabled; used for styling purpose. +document.documentElement.className += ' js'; + +// JavaScript should be made compatible with libraries other than jQuery by +// wrapping it in an anonymous closure. + +(function (domready, Drupal, drupalSettings) { + // Attach all behaviors. + domready(() => { + Drupal.attachBehaviors(document, drupalSettings); + }); +}(domready, Drupal, window.drupalSettings));