diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-06-27 12:08:26 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | 6132d64748dfc6806ed25f71d2e078a5ed29d071 (patch) | |
tree | 0b6bdaf5106d7c27daff0cfb2c541dba362e9d1e /assets/common | |
parent | 764d34a7d347d653414e5f5c632e02499edaef04 (diff) | |
download | Shaarli-6132d64748dfc6806ed25f71d2e078a5ed29d071.tar.gz Shaarli-6132d64748dfc6806ed25f71d2e078a5ed29d071.tar.zst Shaarli-6132d64748dfc6806ed25f71d2e078a5ed29d071.zip |
Process thumbnail synchronize page through Slim controllers
Diffstat (limited to 'assets/common')
-rw-r--r-- | assets/common/js/thumbnails-update.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/assets/common/js/thumbnails-update.js b/assets/common/js/thumbnails-update.js index b37a32f3..3cd4c2a7 100644 --- a/assets/common/js/thumbnails-update.js +++ b/assets/common/js/thumbnails-update.js | |||
@@ -17,7 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | function updateThumb(basePath, ids, i, elements) { | 18 | function updateThumb(basePath, ids, i, elements) { |
19 | const xhr = new XMLHttpRequest(); | 19 | const xhr = new XMLHttpRequest(); |
20 | xhr.open('POST', `${basePath}/?do=ajax_thumb_update`); | 20 | xhr.open('PATCH', `${basePath}/admin/shaare/${ids[i]}/update-thumbnail`); |
21 | xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | 21 | xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); |
22 | xhr.responseType = 'json'; | 22 | xhr.responseType = 'json'; |
23 | xhr.onload = () => { | 23 | xhr.onload = () => { |
@@ -30,14 +30,14 @@ function updateThumb(basePath, ids, i, elements) { | |||
30 | elements.current.innerHTML = i; | 30 | elements.current.innerHTML = i; |
31 | elements.title.innerHTML = response.title; | 31 | elements.title.innerHTML = response.title; |
32 | if (response.thumbnail !== false) { | 32 | if (response.thumbnail !== false) { |
33 | elements.thumbnail.innerHTML = `<img src="${response.thumbnail}">`; | 33 | elements.thumbnail.innerHTML = `<img src="${basePath}/${response.thumbnail}">`; |
34 | } | 34 | } |
35 | if (i < ids.length) { | 35 | if (i < ids.length) { |
36 | updateThumb(basePath, ids, i, elements); | 36 | updateThumb(basePath, ids, i, elements); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | }; | 39 | }; |
40 | xhr.send(`id=${ids[i]}`); | 40 | xhr.send(); |
41 | } | 41 | } |
42 | 42 | ||
43 | (() => { | 43 | (() => { |