when in offline

This commit is contained in:
cutls
2020-11-17 01:36:07 +09:00
parent fa20278727
commit 790ab2065c
12 changed files with 59 additions and 14 deletions

View File

@@ -10,6 +10,15 @@ function sec() {
post(null, mode)
}
function post(mode, postvis, dry) {
if(!navigator.onLine && !dry) {
draftToggle(true)
addToDraft()
M.toast({
html: lang.lang_post_offline,
displayLength: 3000
})
return false
}
if ($('#toot-post-btn').prop('disabled')) {
return false
}

View File

@@ -128,8 +128,8 @@ function schedule() {
}
//下書き機能
function draftToggle() {
if ($('#draft').hasClass('hide')) {
function draftToggle(force) {
if ($('#draft').hasClass('hide') || force) {
$('#draft').removeClass('hide')
$('#right-side').show()
$('#right-side').css('width', '300px')