diff --git a/app/js/platform/end.js b/app/js/platform/end.js index 62fc2e57..4e9eb1a8 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -215,4 +215,14 @@ if(pwa) { } } } -} \ No newline at end of file +} +const connection = function (event) { + console.log(navigator.onLine, 'network state') + if(!navigator.onLine) { + $('#toot-post-btn').addClass('disabled') + } else { + $('#toot-post-btn').removeClass('disabled') + } +} +window.onoffline = connection +window.ononline = connection \ No newline at end of file diff --git a/app/js/ui/post-box.js b/app/js/ui/post-box.js index cec48573..64334e58 100644 --- a/app/js/ui/post-box.js +++ b/app/js/ui/post-box.js @@ -101,7 +101,7 @@ if (location.search) { $('.mini-btn').text('expand_less') } } -window.onload = initPostbox +window.onload = function () { initPostbox(); connection() } function initPostbox() { $('#posttgl').click(function (e) { if (!$('#post-box').hasClass('appear')) { diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index fef4b6ed..20b535ab 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -1085,7 +1085,7 @@
- +
diff --git a/app/view/make/setting.sample.html b/app/view/make/setting.sample.html index 646ce7ff..15f468b8 100644 --- a/app/view/make/setting.sample.html +++ b/app/view/make/setting.sample.html @@ -43,6 +43,7 @@ +

@@setting@@