diff --git a/core/modules/node/node.js b/core/modules/node/node.js index 0899d3c..1816144 100644 --- a/core/modules/node/node.js +++ b/core/modules/node/node.js @@ -45,4 +45,20 @@ Drupal.behaviors.nodeFieldsetSummaries = { } }; +/** + * Disabling all links in node previews to prevent users from leaving the page. + */ +Drupal.behaviors.nodePreviewDestroyLinks = { + attach: function (context) { + $('.node.preview', context).once('node-preview', function () { + $(this).find('a').each(function () { + $(this).click(function(e) { + e.preventDefault(); + alert('Option not available in preview mode.'); + }); + }); + }); + } +}; + })(jQuery);