Fix: when failed to upload
This commit is contained in:
parent
d92570fa3b
commit
eb02dd2986
|
@ -243,7 +243,6 @@ function tootSelector(column, toot) {
|
|||
var scr = $('.tl-box[tlid=' + column + ']').scrollTop()
|
||||
var elem = $('.selectedToot').offset().top
|
||||
var top = elem - $('.tl-box').height() + scr
|
||||
console.log(elem, top, scr)
|
||||
if (top > 0) {
|
||||
top = top + $('.selectedToot').height()
|
||||
if(top > scr){
|
||||
|
|
|
@ -47,6 +47,7 @@ var lang = {
|
|||
//post/img.js
|
||||
"lang_postimg_previewdis": "cannot preview",
|
||||
"lang_postimg_aftupload": "You cannot change accounts after uploading.",
|
||||
"lang_postimg_failupload": "Failed",
|
||||
"lang_postimg_delete": "Delete this image.",
|
||||
//post/post.js
|
||||
"lang_post_tagTL": "This toot does not contain a default tag. This toot will not be shown on Local TL. Continue?",
|
||||
|
|
|
@ -47,6 +47,7 @@ var lang = {
|
|||
//post/img.js
|
||||
"lang_postimg_previewdis": "プレビューできません。",
|
||||
"lang_postimg_aftupload": "アップロード後はアカウントを切り替えられません。",
|
||||
"lang_postimg_failupload": "アップロードに失敗しました。",
|
||||
"lang_postimg_delete": "この画像を削除します",
|
||||
//post/post.js
|
||||
"lang_post_tagTL": "デフォルトタグが挿入されていません。このまま投稿するとローカルには表示されません。",
|
||||
|
|
|
@ -120,6 +120,16 @@ function media(b64, type, no) {
|
|||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if (!json.id) {
|
||||
todc();
|
||||
$("#imgup").text("");
|
||||
$(".toot-btn-group").prop("disabled", false);
|
||||
$("#post-acct-sel").prop("disabled", false);
|
||||
$('select').formSelect();
|
||||
$("#imgsel").show();
|
||||
M.toast({ html: lang.lang_postimg_failupload, displayLength: 5000 })
|
||||
return false
|
||||
}
|
||||
var img = localStorage.getItem("img");
|
||||
if (json.type.indexOf("image") != -1) {
|
||||
var html = '<img src="' + json[previewer] + '" class="preview-img pointer" data-media="' + json["id"] + '" onclick="deleteImage(\'' + json["id"] + '\')" title="' + lang.lang_postimg_delete + '">';
|
||||
|
|
Loading…
Reference in New Issue
Block a user