diff options
Diffstat (limited to 'public')
| -rw-r--r-- | public/js/Input.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/public/js/Input.js b/public/js/Input.js index 9a131c8..be7cd8d 100644 --- a/public/js/Input.js +++ b/public/js/Input.js | |||
| @@ -98,7 +98,8 @@ class InputFile extends InputToggler{ | |||
| 98 | this.close(); | 98 | this.close(); |
| 99 | } | 99 | } |
| 100 | else{ | 100 | else{ |
| 101 | console.error("Erreur: le serveur n'a pas enregistré l'image'."); | 101 | this.onFailure(data); |
| 102 | console.error(data.message); | ||
| 102 | } | 103 | } |
| 103 | }) | 104 | }) |
| 104 | .catch(error => { | 105 | .catch(error => { |
| @@ -108,6 +109,11 @@ class InputFile extends InputToggler{ | |||
| 108 | onSuccess(data){ | 109 | onSuccess(data){ |
| 109 | this.content_elem.src = data.location; | 110 | this.content_elem.src = data.location; |
| 110 | } | 111 | } |
| 112 | onFailure(data){ | ||
| 113 | if(data.format === 'ico'){ | ||
| 114 | toastNotify("Format ICO mal géré par le serveur, essayez avec un PNG."); | ||
| 115 | } | ||
| 116 | } | ||
| 111 | } | 117 | } |
| 112 | 118 | ||
| 113 | class InputFileFavicon extends InputFile{ | 119 | class InputFileFavicon extends InputFile{ |
