diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-24 02:27:19 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-24 02:27:19 +0200 |
| commit | 5311271ae590460b986e3e09edcdc665b73710ca (patch) | |
| tree | f31f6b9602d1607e838a7a4bfe320db9c8d44bb4 /public/js/InputFile.js | |
| parent | f9a9bf1ae4fac9317fd71f0bcb207544b000e6f1 (diff) | |
| download | cms-5311271ae590460b986e3e09edcdc665b73710ca.zip | |
entité pour table intermédiaire à 3 champs entre NodeData et Asset, table Asset repensée
Diffstat (limited to 'public/js/InputFile.js')
| -rw-r--r-- | public/js/InputFile.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/public/js/InputFile.js b/public/js/InputFile.js index f5e450c..e676037 100644 --- a/public/js/InputFile.js +++ b/public/js/InputFile.js | |||
| @@ -35,7 +35,18 @@ class InputFile{ | |||
| 35 | .then(data => { | 35 | .then(data => { |
| 36 | if(data.success){ | 36 | if(data.success){ |
| 37 | this.parent.querySelector('#' + this.name + '_img').src = data.location; | 37 | this.parent.querySelector('#' + this.name + '_img').src = data.location; |
| 38 | this.close(this.name); | 38 | |
| 39 | // cas particulier | ||
| 40 | if(this.name === 'head_favicon'){ | ||
| 41 | const link = document.querySelector('link[rel="icon"]'); | ||
| 42 | link.type = data.mime_type; | ||
| 43 | link.href = data.location; | ||
| 44 | } | ||
| 45 | else if(this.name === 'header_background'){ | ||
| 46 | document.querySelector('header').style.backgroundImage = "url('" + data.location + "')"; | ||
| 47 | } | ||
| 48 | |||
| 49 | this.close(); | ||
| 39 | } | 50 | } |
| 40 | else{ | 51 | else{ |
| 41 | console.error("Erreur: le serveur n'a pas enregistré l'image'."); | 52 | console.error("Erreur: le serveur n'a pas enregistré l'image'."); |
| @@ -46,6 +57,6 @@ class InputFile{ | |||
| 46 | }); | 57 | }); |
| 47 | } | 58 | } |
| 48 | cancel(){ | 59 | cancel(){ |
| 49 | this.close(this.name); | 60 | this.close(); |
| 50 | } | 61 | } |
| 51 | } \ No newline at end of file | 62 | } \ No newline at end of file |
