Commit 765c10b6 authored by catch's avatar catch

Issue #2422017 by penyaskito, MobliMic, nod_: Split drupal.js

parent f4a242f1
......@@ -46,6 +46,7 @@ drupal:
version: VERSION
js:
misc/drupal.js: { weight: -18 }
misc/drupal.init.js: { weight: -17 }
dependencies:
- core/domready
- core/drupalSettings
......
// 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) {
'use strict';
// Attach all behaviors.
domready(function () { Drupal.attachBehaviors(document, drupalSettings); });
})(domready, Drupal, window.drupalSettings);
......@@ -40,17 +40,9 @@
*/
window.Drupal = {behaviors: {}, locale: {}};
// Class indicating that JavaScript is enabled; used for styling purpose.
document.documentElement.className += ' js';
// Allow other JavaScript libraries to use $.
if (window.jQuery) {
jQuery.noConflict();
}
// JavaScript should be made compatible with libraries other than jQuery by
// wrapping it in an anonymous closure.
(function (domready, Drupal, drupalSettings, drupalTranslations) {
(function (Drupal, drupalSettings, drupalTranslations) {
'use strict';
......@@ -174,9 +166,6 @@ if (window.jQuery) {
}
};
// Attach all behaviors.
domready(function () { Drupal.attachBehaviors(document, drupalSettings); });
/**
* Detaches registered behaviors from a page element.
*
......@@ -591,4 +580,4 @@ if (window.jQuery) {
return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>';
};
})(domready, Drupal, window.drupalSettings, window.drupalTranslations);
})(Drupal, window.drupalSettings, window.drupalTranslations);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment