Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
24
core/misc/drupalSettingsLoader.js
Normal file
24
core/misc/drupalSettingsLoader.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @file
|
||||
* Parse inline JSON and initialize the drupalSettings global object.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
"use strict";
|
||||
|
||||
var settingsElement = document.querySelector('script[type="application/json"][data-drupal-selector="drupal-settings-json"]');
|
||||
|
||||
/**
|
||||
* Variable generated by Drupal with all the configuration created from PHP.
|
||||
*
|
||||
* @global
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
window.drupalSettings = {};
|
||||
|
||||
if (settingsElement !== null) {
|
||||
window.drupalSettings = JSON.parse(settingsElement.textContent);
|
||||
}
|
||||
})();
|
Reference in a new issue