Skip to content

Commit a130648

Browse files
authored
Merge pull request #84 from DMOJ/preview-stale
Indicate that preview is being updated
2 parents a950712 + 182693e commit a130648

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

martor/static/martor/css/martor.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ form .martor-preview {
225225
background: #F9F9F9;
226226
}
227227

228+
form .martor-preview-stale {
229+
background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f8f8f8 10px, #f8f8f8 20px) !important;
230+
}
231+
228232
.icon.expand-editor {
229233
position: absolute;
230234
bottom: .8em;

martor/static/martor/css/martor.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
var form = new FormData();
148148
form.append('content', value);
149149
form.append('csrfmiddlewaretoken', getCookie('csrftoken'));
150+
currentTab.addClass('martor-preview-stale');
150151

151152
$.ajax({
152153
url: textareaId.data('markdownfy-url'),
@@ -156,7 +157,7 @@
156157
contentType: false,
157158
success: function(response) {
158159
if(response){
159-
currentTab.html(response);
160+
currentTab.html(response).removeClass('martor-preview-stale');
160161
$('pre').each(function(i, block){
161162
hljs.highlightBlock(block);
162163
});

0 commit comments

Comments
 (0)