Preview: add hint for live preview

This commit is contained in:
Le Tan 2018-08-08 20:40:33 +08:00
parent 56bcc9be54
commit 8055f17d1f
5 changed files with 46 additions and 0 deletions

View File

@ -1400,9 +1400,15 @@ var handleGraphvizResult = function(id, timeStamp, format, result) {
};
var setPreviewEnabled = function(enabled) {
var hint = '<div class="preview-hint">' +
'<h3>Live Preview for Diagrams</h3>' +
'<p>Place the cursor on the definition of a diagram to preview.</p>' +
'</div>';
if (enabled) {
contentDiv.style.display = 'none';
previewDiv.style.display = 'block';
previewDiv.innerHTML = hint;
} else {
contentDiv.style.display = 'block';
previewDiv.style.display = 'none';

View File

@ -225,6 +225,16 @@ div.img-caption {
margin-right: 8px;
}
div.preview-hint {
opacity: 0.5;
margin-top: 30%;
margin-bottom: 30%;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
/* For Highlight.js Line Number */
table.hljs-ln tr {
border: none;

View File

@ -223,6 +223,16 @@ div.img-caption {
margin-right: 8px;
}
div.preview-hint {
opacity: 0.5;
margin-top: 30%;
margin-bottom: 30%;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
/* For Highlight.js Line Number */
table.hljs-ln tr {
border: none;

View File

@ -217,6 +217,16 @@ div.img-caption {
margin-right: 8px;
}
div.preview-hint {
opacity: 0.5;
margin-top: 30%;
margin-bottom: 30%;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
/* For Highlight.js Line Number */
table.hljs-ln tr {
border: none;

View File

@ -219,6 +219,16 @@ div.img-caption {
margin-right: 8px;
}
div.preview-hint {
opacity: 0.5;
margin-top: 30%;
margin-bottom: 30%;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
/* For Highlight.js Line Number */
table.hljs-ln tr {
border: none;