|
@@ -10,6 +10,7 @@ export default class Page extends React.Component {
|
|
|
|
|
|
|
|
this.state = {};
|
|
this.state = {};
|
|
|
|
|
|
|
|
|
|
+ this.appendEditSectionButtons = this.appendEditSectionButtons.bind(this);
|
|
|
this.renderHtml = this.renderHtml.bind(this);
|
|
this.renderHtml = this.renderHtml.bind(this);
|
|
|
// this.getHighlightBody = this.getHighlightBody.bind(this);
|
|
// this.getHighlightBody = this.getHighlightBody.bind(this);
|
|
|
}
|
|
}
|
|
@@ -34,6 +35,21 @@ export default class Page extends React.Component {
|
|
|
// return returnBody;
|
|
// return returnBody;
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
+ componentDidUpdate() {
|
|
|
|
|
+ this.appendEditSectionButtons();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Add edit section buttons to headers
|
|
|
|
|
+ * This invoke `appendEditSectionButtons` method of `legacy/crowi.js`
|
|
|
|
|
+ */
|
|
|
|
|
+ appendEditSectionButtons(parentElement) {
|
|
|
|
|
+ if (this.props.showHeadEditButton) {
|
|
|
|
|
+ const crowiForJquery = this.props.crowi.getCrowiForJquery();
|
|
|
|
|
+ crowiForJquery.appendEditSectionButtons(this.previewElement);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
renderHtml(markdown) {
|
|
renderHtml(markdown) {
|
|
|
var context = {
|
|
var context = {
|
|
|
markdown,
|
|
markdown,
|
|
@@ -86,5 +102,6 @@ Page.propTypes = {
|
|
|
crowiRenderer: PropTypes.object.isRequired,
|
|
crowiRenderer: PropTypes.object.isRequired,
|
|
|
markdown: PropTypes.string.isRequired,
|
|
markdown: PropTypes.string.isRequired,
|
|
|
pagePath: PropTypes.string.isRequired,
|
|
pagePath: PropTypes.string.isRequired,
|
|
|
|
|
+ showHeadEditButton: PropTypes.bool,
|
|
|
highlightKeywords: PropTypes.string,
|
|
highlightKeywords: PropTypes.string,
|
|
|
};
|
|
};
|