Issue #2422017 by penyaskito, MobliMic, nod_: Split drupal.js
parent
f4a242f154
commit
765c10b69f
|
@ -46,6 +46,7 @@ drupal:
|
|||
version: VERSION
|
||||
js:
|
||||
misc/drupal.js: { weight: -18 }
|
||||
misc/drupal.init.js: { weight: -17 }
|
||||
dependencies:
|
||||
- core/domready
|
||||
- core/drupalSettings
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// 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);
|
||||
|
|
Loading…
Reference in New Issue