Skip to content

Commit

Permalink
TASK: get documentNode id from metadata
Browse files Browse the repository at this point in the history
Thanks, @kitsunet!
  • Loading branch information
dimaip committed Nov 2, 2016
1 parent d35764c commit 10ce077
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions Resources/Private/TypoScript/Root.ts2
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Inspector/Views/AnchorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 10ce077

Please sign in to comment.