Skip to content

Instantly share code, notes, and snippets.

@theopendle
Created September 18, 2019 16:42
Show Gist options
  • Save theopendle/b2f3b2cb255d9fcebb4503408d09fd1f to your computer and use it in GitHub Desktop.
Save theopendle/b2f3b2cb255d9fcebb4503408d09fd1f to your computer and use it in GitHub Desktop.
$(document).on('foundation-contentloaded', function() {
console.log('previewAssetActions.js loaded');
// Get the path to the AEM asset
let assetPath = window.location.pathname.replace('/assetdetails.html', '');
// Modify the href attribute of the Preview toolbar action
$('.customization-preview-asset-toolbar-action').attr('href',
window.location.origin
+ '/bin/imageViewerServlet?assetPath='
+ encodeURIComponent(assetPath));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment