projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website]
/
web
/
core
/
modules
/
big_pipe
/
js
/
big_pipe.js
diff --git
a/web/core/modules/big_pipe/js/big_pipe.js
b/web/core/modules/big_pipe/js/big_pipe.js
index 1464fdd968202268b4a23be8e1004e4d1152fc3f..b8a25f77cc8987832ec660ba87dea22329419b83 100644
(file)
--- a/
web/core/modules/big_pipe/js/big_pipe.js
+++ b/
web/core/modules/big_pipe/js/big_pipe.js
@@
-11,11
+11,11
@@
var content = this.textContent.trim();
if (typeof drupalSettings.bigPipePlaceholderIds[placeholderId] !== 'undefined') {
var content = this.textContent.trim();
if (typeof drupalSettings.bigPipePlaceholderIds[placeholderId] !== 'undefined') {
- if (content === '') {
+ var response = mapTextContentToAjaxResponse(content);
+
+ if (response === false) {
$(this).removeOnce('big-pipe');
} else {
$(this).removeOnce('big-pipe');
} else {
- var response = JSON.parse(content);
-
var ajaxObject = Drupal.ajax({
url: '',
base: false,
var ajaxObject = Drupal.ajax({
url: '',
base: false,
@@
-28,6
+28,18
@@
}
}
}
}
+ function mapTextContentToAjaxResponse(content) {
+ if (content === '') {
+ return false;
+ }
+
+ try {
+ return JSON.parse(content);
+ } catch (e) {
+ return false;
+ }
+ }
+
function bigPipeProcessDocument(context) {
if (!context.querySelector('script[data-big-pipe-event="start"]')) {
return false;
function bigPipeProcessDocument(context) {
if (!context.querySelector('script[data-big-pipe-event="start"]')) {
return false;