Issue #2422017 by penyaskito, MobliMic, nod_: Split drupal.js
parent
f4a242f154
commit
765c10b69f
|
@ -46,6 +46,7 @@ drupal:
|
||||||
version: VERSION
|
version: VERSION
|
||||||
js:
|
js:
|
||||||
misc/drupal.js: { weight: -18 }
|
misc/drupal.js: { weight: -18 }
|
||||||
|
misc/drupal.init.js: { weight: -17 }
|
||||||
dependencies:
|
dependencies:
|
||||||
- core/domready
|
- core/domready
|
||||||
- core/drupalSettings
|
- 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: {}};
|
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
|
// JavaScript should be made compatible with libraries other than jQuery by
|
||||||
// wrapping it in an anonymous closure.
|
// wrapping it in an anonymous closure.
|
||||||
(function (domready, Drupal, drupalSettings, drupalTranslations) {
|
(function (Drupal, drupalSettings, drupalTranslations) {
|
||||||
|
|
||||||
'use strict';
|
'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.
|
* Detaches registered behaviors from a page element.
|
||||||
*
|
*
|
||||||
|
@ -591,4 +580,4 @@ if (window.jQuery) {
|
||||||
return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>';
|
return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>';
|
||||||
};
|
};
|
||||||
|
|
||||||
})(domready, Drupal, window.drupalSettings, window.drupalTranslations);
|
})(Drupal, window.drupalSettings, window.drupalTranslations);
|
||||||
|
|
Loading…
Reference in New Issue