improve post title flow

pull/181/head
Aevann 2023-08-06 06:26:16 +03:00
parent 8cf490975d
commit 4c3b2dd4d2
3 changed files with 9 additions and 1 deletions

View File

@ -15,3 +15,7 @@ function togglePostEdit(id){
close_inline_speed_emoji_modal();
};
document.getElementById('post-edit-title').addEventListener('keydown', (e) => {
if(e.key === "Enter") e.preventDefault();
})

View File

@ -155,6 +155,10 @@ document.addEventListener('keydown', (e) => {
submitButton.click();
});
document.getElementById('post-title').addEventListener('keydown', (e) => {
if(e.key === "Enter") e.preventDefault();
})
checkRepost();
function submit(form) {

View File

@ -30,7 +30,7 @@
</datalist>
</div>
<label class='mt-4' for="title">Post Title</label>
<input autocomplete="off" class="form-control allow-emojis" id="post-title" type="text" name="title" placeholder="Required" value="{{title}}" minlength="1" maxlength="500" required data-nonce="{{g.nonce}}" data-oninput="checkForRequired();savetext()">
<textarea autocomplete="off" class="form-control allow-emojis" id="post-title" type="text" name="title" placeholder="Required" value="{{title}}" minlength="1" maxlength="500" required data-nonce="{{g.nonce}}" data-oninput="checkForRequired();savetext()"></textarea>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="loadEmojis('post-title')" class="btn btn-secondary format d-inline-block m-0" id="emoji-reply-btn-2" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Add Emoji"><i class="fas fa-smile-beam"></i></button>
<div id="urlblock">
<label for="URL" class="mt-3">URL</label>