diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-28 23:23:03 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-28 23:23:03 +0100 |
| commit | f653506421ee8e2c46c78e93d28ee2418a1d399d (patch) | |
| tree | 93f54c301538960f543ffdb5fafd387c83dec94a /public/js/Input.js | |
| parent | cf8c9c1d380afbd8529a6da0afd55a9e3d8f1bf4 (diff) | |
| download | cms-f653506421ee8e2c46c78e93d28ee2418a1d399d.zip | |
modification liens réseaux sociaux, placeholder input text, correction erreurs CSS
Diffstat (limited to 'public/js/Input.js')
| -rw-r--r-- | public/js/Input.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/public/js/Input.js b/public/js/Input.js index be7cd8d..6c5af10 100644 --- a/public/js/Input.js +++ b/public/js/Input.js | |||
| @@ -54,7 +54,7 @@ class InputText extends InputToggler{ | |||
| 54 | .then(response => response.json()) | 54 | .then(response => response.json()) |
| 55 | .then(data => { | 55 | .then(data => { |
| 56 | if(data.success){ | 56 | if(data.success){ |
| 57 | this.content_elem.innerHTML = this.input_elem.value; | 57 | this.onSuccess(data); |
| 58 | this.close(); | 58 | this.close(); |
| 59 | } | 59 | } |
| 60 | else{ | 60 | else{ |
| @@ -65,12 +65,25 @@ class InputText extends InputToggler{ | |||
| 65 | console.error('Erreur:', error); | 65 | console.error('Erreur:', error); |
| 66 | }); | 66 | }); |
| 67 | } | 67 | } |
| 68 | onSuccess(data){ | ||
| 69 | this.content_elem.innerHTML = this.input_elem.value; | ||
| 70 | } | ||
| 68 | cancel(){ | 71 | cancel(){ |
| 69 | this.input_elem.value = this.content_elem.innerHTML; | 72 | this.input_elem.value = this.content_elem.innerHTML; |
| 70 | super.cancel(); | 73 | super.cancel(); |
| 71 | } | 74 | } |
| 72 | } | 75 | } |
| 73 | 76 | ||
| 77 | class InputTextSocialNetwork extends InputText{ | ||
| 78 | open(){ | ||
| 79 | this.input_elem.value = this.content_elem.parentNode.href; | ||
| 80 | super.open(); | ||
| 81 | } | ||
| 82 | onSuccess(data){ | ||
| 83 | this.content_elem.parentNode.href = this.input_elem.value; | ||
| 84 | } | ||
| 85 | } | ||
| 86 | |||
| 74 | class InputFile extends InputToggler{ | 87 | class InputFile extends InputToggler{ |
| 75 | constructor(name, options = {}){ | 88 | constructor(name, options = {}){ |
| 76 | super(name, options); | 89 | super(name, options); |
