Mercurial > hg > cmmr2012-drupal-site
annotate core/misc/drupal.init.es6.js @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | a9cd425dd02b |
rev | line source |
---|---|
Chris@0 | 1 // Allow other JavaScript libraries to use $. |
Chris@0 | 2 if (window.jQuery) { |
Chris@0 | 3 jQuery.noConflict(); |
Chris@0 | 4 } |
Chris@0 | 5 |
Chris@0 | 6 // Class indicating that JS is enabled; used for styling purpose. |
Chris@0 | 7 document.documentElement.className += ' js'; |
Chris@0 | 8 |
Chris@0 | 9 // JavaScript should be made compatible with libraries other than jQuery by |
Chris@0 | 10 // wrapping it in an anonymous closure. |
Chris@0 | 11 |
Chris@0 | 12 (function (domready, Drupal, drupalSettings) { |
Chris@0 | 13 // Attach all behaviors. |
Chris@0 | 14 domready(() => { |
Chris@0 | 15 Drupal.attachBehaviors(document, drupalSettings); |
Chris@0 | 16 }); |
Chris@0 | 17 }(domready, Drupal, window.drupalSettings)); |