From 10ce0772cc417130a26639341b3a28c9b4951dec Mon Sep 17 00:00:00 2001 From: Dmitri Pisarev Date: Wed, 2 Nov 2016 17:48:56 +0300 Subject: [PATCH] TASK: get documentNode id from metadata Thanks, @kitsunet! --- Resources/Private/TypoScript/Root.ts2 | 10 ---------- .../Public/JavaScript/Inspector/Views/AnchorView.js | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Resources/Private/TypoScript/Root.ts2 b/Resources/Private/TypoScript/Root.ts2 index a76d420..4c4c4fd 100644 --- a/Resources/Private/TypoScript/Root.ts2 +++ b/Resources/Private/TypoScript/Root.ts2 @@ -5,13 +5,3 @@ prototype(Flownative.Anchorlinks:AnchorWrapper) < prototype(TYPO3.TypoScript:Val } value = ${q(node).property('sectionId') ? this.anchor + value : value} } - -# Render documentNode identifier to access it in anchor view -prototype(TYPO3.Neos:Page).head.anchorHelper = TYPO3.TypoScript:Tag { - tagName = 'meta' - attributes { - name = 'anchor-documentNodeIdentifier' - content = ${documentNode.identifier} - } - @if.inBackend = ${node.context.inBackend ? true : false} -} diff --git a/Resources/Public/JavaScript/Inspector/Views/AnchorView.js b/Resources/Public/JavaScript/Inspector/Views/AnchorView.js index 622c94b..7218234 100644 --- a/Resources/Public/JavaScript/Inspector/Views/AnchorView.js +++ b/Resources/Public/JavaScript/Inspector/Views/AnchorView.js @@ -18,7 +18,7 @@ function( return this.get('inspector.nodeProperties.sectionId') ? true : false; }.property('inspector.nodeProperties.sectionId'), copyToClipboard: function () { - var documentNodeIdentifier = document.querySelector('[name="anchor-documentNodeIdentifier"]').getAttribute('content'); + var documentNodeIdentifier = document.getElementById('neos-document-metadata').dataset['node-_identifier']; var link = 'node://' + documentNodeIdentifier + '#' + this.get('inspector.nodeProperties.sectionId'); var textArea = document.createElement('textarea'); textArea.innerText = link;