|
|
@@ -17,7 +17,7 @@ require('jquery.cookie');
|
|
|
require('bootstrap-select');
|
|
|
|
|
|
import GrowiRenderer from '../util/GrowiRenderer';
|
|
|
-import RevisionRenderer from '../components/Page/RevisionRenderer';
|
|
|
+import RevisionLoader from '../components/Page/RevisionLoader';
|
|
|
|
|
|
require('./thirdparty-js/agile-admin');
|
|
|
|
|
|
@@ -525,7 +525,7 @@ $(function() {
|
|
|
|
|
|
// for list page
|
|
|
let growiRendererForTimeline = null;
|
|
|
- $('a[data-toggle="tab"][href="#view-timeline"]').on('show.bs.tab', function() {
|
|
|
+ $('a[data-toggle="tab"][href="#view-timeline"]').on('shown.bs.tab', function() {
|
|
|
const isShown = $('#view-timeline').data('shown');
|
|
|
|
|
|
if (growiRendererForTimeline == null) {
|
|
|
@@ -535,16 +535,21 @@ $(function() {
|
|
|
if (isShown == 0) {
|
|
|
$('#view-timeline .timeline-body').each(function() {
|
|
|
const id = $(this).attr('id');
|
|
|
- const contentId = '#' + id + ' > script';
|
|
|
const revisionBody = '#' + id + ' .revision-body';
|
|
|
const revisionBodyElem = document.querySelector(revisionBody);
|
|
|
/* eslint-disable no-unused-vars */
|
|
|
const revisionPath = '#' + id + ' .revision-path';
|
|
|
/* eslint-enable */
|
|
|
- const pagePath = document.getElementById(id).getAttribute('data-page-path');
|
|
|
- const markdown = entities.decodeHTML($(contentId).html());
|
|
|
-
|
|
|
- ReactDOM.render(<RevisionRenderer crowi={crowi} crowiRenderer={growiRendererForTimeline} markdown={markdown} pagePath={pagePath} />, revisionBodyElem);
|
|
|
+ const timelineElm = document.getElementById(id);
|
|
|
+ const pageId = timelineElm.getAttribute('data-page-id');
|
|
|
+ const pagePath = timelineElm.getAttribute('data-page-path');
|
|
|
+ const revisionId = timelineElm.getAttribute('data-revision');
|
|
|
+
|
|
|
+ ReactDOM.render(
|
|
|
+ <RevisionLoader lazy={true}
|
|
|
+ crowi={crowi} crowiRenderer={growiRendererForTimeline}
|
|
|
+ pageId={pageId} pagePath={pagePath} revisionId={revisionId} />,
|
|
|
+ revisionBodyElem);
|
|
|
});
|
|
|
|
|
|
$('#view-timeline').data('shown', 1);
|