summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/drupal.init.es6.js
blob: 62cd029e46aa4a936a2c56066974a1d9a0f8c1ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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));