diff options
| author | polo <ordipolo@gmx.fr> | 2025-09-09 15:37:50 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-09-09 15:37:50 +0200 |
| commit | 5e41bea598ff38b3c520b69fd92ee3412e716df2 (patch) | |
| tree | b4b57a7201db1efe484446383042f9a43fd2deff /public/js/main.js | |
| parent | c5d9df5c42b5d2522e2a06b5f40422c1bbf497ab (diff) | |
| download | cms-5e41bea598ff38b3c520b69fd92ee3412e716df2.tar.gz cms-5e41bea598ff38b3c520b69fd92ee3412e716df2.tar.bz2 cms-5e41bea598ff38b3c520b69fd92ee3412e716df2.zip | |
fin de l'utilisation du champ article_timestamp de la table node, résolue erreur lorsque deux news sont créées dans la même minute (pas dans la même seconde par contre)
Diffstat (limited to 'public/js/main.js')
| -rw-r--r-- | public/js/main.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/public/js/main.js b/public/js/main.js index 8f2b214..2936ea0 100644 --- a/public/js/main.js +++ b/public/js/main.js | |||
| @@ -80,8 +80,9 @@ document.addEventListener('DOMContentLoaded', () => { // pour pouvoir attraper l | |||
| 80 | // complète les fonctions dans tinymce.js | 80 | // complète les fonctions dans tinymce.js |
| 81 | function switchPositions(article_id, direction) | 81 | function switchPositions(article_id, direction) |
| 82 | { | 82 | { |
| 83 | const current_article = findParentByTagName(document.getElementById(article_id), 'article'); // l'id n'est pas sur la bonne balise | 83 | const current_article = findParentByTagName(document.getElementById(article_id), 'article'); // l'id n'est pas toujours sur la même balise |
| 84 | var other_article; | 84 | let other_article; |
| 85 | let other_article_id; | ||
| 85 | 86 | ||
| 86 | if(direction == 'down'){ | 87 | if(direction == 'down'){ |
| 87 | other_article = current_article.nextElementSibling; | 88 | other_article = current_article.nextElementSibling; |
| @@ -90,10 +91,8 @@ function switchPositions(article_id, direction) | |||
| 90 | other_article = current_article.previousElementSibling; | 91 | other_article = current_article.previousElementSibling; |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | var other_article_id; | ||
| 94 | try{ | 94 | try{ |
| 95 | other_article_id = other_article.querySelector('div[id]').id; | 95 | other_article_id = other_article.querySelector('div[id]').id; |
| 96 | other_article_id = 'i' + other_article_id.slice(1); // peut mieux faire | ||
| 97 | } | 96 | } |
| 98 | catch(error){ | 97 | catch(error){ |
| 99 | console.log('Inversion impossible'); | 98 | console.log('Inversion impossible'); |
