Fix some quirks in editor loading
This commit is contained in:
parent
8f58c04db1
commit
79cbaf47a5
|
@ -46,7 +46,9 @@ def get_player_drafts(
|
||||||
return drafts
|
return drafts
|
||||||
|
|
||||||
|
|
||||||
def get_draft(lexicon: LexiconModel, aid: str) -> Optional[ReadOnlyOrderedDict]:
|
def get_draft(
|
||||||
|
lexicon: LexiconModel,
|
||||||
|
aid: str) -> Optional[ReadOnlyOrderedDict]:
|
||||||
"""
|
"""
|
||||||
Loads an article from its id
|
Loads an article from its id
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -18,7 +18,9 @@ window.onload = function() {
|
||||||
// Kill noscript message first
|
// Kill noscript message first
|
||||||
document.getElementById("preview").innerHTML = "<p> </p>";
|
document.getElementById("preview").innerHTML = "<p> </p>";
|
||||||
|
|
||||||
|
if (document.body.contains(document.getElementById("editor-content"))) {
|
||||||
onContentChange(0);
|
onContentChange(0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function buildArticleObject() {
|
function buildArticleObject() {
|
||||||
|
@ -77,7 +79,8 @@ function updatePreview(response) {
|
||||||
}
|
}
|
||||||
var warning = "";
|
var warning = "";
|
||||||
for (var i = 0; i < response.warning.length; i++) {
|
for (var i = 0; i < response.warning.length; i++) {
|
||||||
warning += "<span class=\"message-warning\">" + response.warning[i] + "</span><br>";
|
warning += "<span class=\"message-warning\">" +
|
||||||
|
response.warning[i] + "</span><br>";
|
||||||
}
|
}
|
||||||
var error = "";
|
var error = "";
|
||||||
for (var i = 0; i < response.error.length; i++) {
|
for (var i = 0; i < response.error.length; i++) {
|
||||||
|
|
|
@ -99,7 +99,9 @@
|
||||||
<button>~</button>
|
<button>~</button>
|
||||||
</div>
|
</div>
|
||||||
<input id="editor-title" placeholder="Title" oninput="onContentChange()" disabled value="{{ article.title }}">
|
<input id="editor-title" placeholder="Title" oninput="onContentChange()" disabled value="{{ article.title }}">
|
||||||
<textarea id="editor-content" class="fullwidth" oninput="onContentChange()" disabled>{{ article.contents }}</textarea>
|
<textarea id="editor-content" class="fullwidth" oninput="onContentChange()" disabled>
|
||||||
|
{# #}{{ article.contents }}{#
|
||||||
|
#}</textarea>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue