As-tu VIDE le CACHE navigateur ?
Version imprimable
As-tu VIDE le CACHE navigateur ?
Oui je viens de le faire.
Je fais de mon mieux pour comprendre ... et je pense que c'est un succession d'erreurs ...
Je regarde ce que tu m'as demandé de faire et j'ai des questions.
Tu m'as demandé de commenter dans resizeTables.js ce bout de code en fin de fichier :
Code:
1
2
3 window.onresize = function () { table_thead_fixed_resize(); }
ce qui donne ceci pour resizeTables.js
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 "use strict"; function table_thead_fixed() { let tableDivWraps = document.querySelectorAll(".table-thead-fixed"); tableDivWraps.forEach(function (tableDivWrap) { let tableRef = tableDivWrap.children[0], tableBodyScroll = document.createElement("div"); tableBodyScroll.className += "tbody-scroll"; tableDivWrap.insertBefore(tableBodyScroll, tableRef); tableBodyScroll.appendChild(tableRef); let tableHeadFixed = document.createElement("div"); tableHeadFixed.className += "theader-fixed"; tableHeadFixed.appendChild(tableRef.cloneNode(true)); tableDivWrap.prepend(tableHeadFixed); }); table_thead_fixed_resize(); } function table_thead_fixed_resize() { let tableDivWraps = document.querySelectorAll(".table-thead-fixed"); tableDivWraps.forEach(function (tableDivWrap) { let nbLigne = tableDivWrap.dataset.nbreligne !== undefined ? tableDivWrap.dataset.nbreligne : 20, tableHeadFixed = tableDivWrap.children[0], tableBodyScroll = tableDivWrap.children[1], tableRef = tableBodyScroll.children[0], hScrollBar = tableBodyScroll.offsetHeight - tableBodyScroll.clientHeight, nbLigneToShow = Math.min(nbLigne, tableRef.rows.length) + 1, rect1 = tableRef.rows[0].getBoundingClientRect(), rect2 = tableRef.rows[nbLigneToShow].getBoundingClientRect(); tableBodyScroll.style.height = rect2.top - rect1.top + hScrollBar + "px"; let hEntete = tableRef.tHead.offsetHeight, wScrollBar = tableBodyScroll.offsetWidth - tableBodyScroll.clientWidth; tableHeadFixed.style.height = hEntete + "px"; tableHeadFixed.style.width = "calc(100% - " + wScrollBar + "px)"; tableBodyScroll.onscroll = function () { tableHeadFixed.style.marginLeft = -this.scrollLeft + "px"; }; }); } window.onload = function () { table_thead_fixed(); } /* window.onresize = function () { table_thead_fixed_resize(); } */
Autrement, dans dashboard.js, je n'ai modifié que ceci :
// table-wrap table-thead-fixed ou table-thead-fixedCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 function makeFriendsHTML(rf) { var field = "speed"; if (rf === undefined) { return "No friend positions received yet"; } else { sortFriends(rf); return '<div class="table-thead-fixed">' // table-wrap table-thead-fixed ou table-thead-fixed + '<table style=\"width:100%\">' + '<thead>' + friendListHeader() + '</thead>' + '<tbody>' + Array.from(rf.table || []).map(makeFriendListLine, rf).join(' '); + '</tbody>' + '</table>' + '</div>'; } } function makeTableHTML(r) { return '<div class="table-thead-fixed">' // table-wrap table-thead-fixed ou table-thead-fixed + '<table style="width:100%">' + '<thead>' + tableHeader + '</thead>' + '<tbody>' + (r === undefined ? "" : r.tableLines.join(' ')) + '</tbody>' + '</table>' + '</div>'; }
Je dirais table-thead-fixed ... la div table-wrap je m'en sers pas...
Argh....
On a oublié (mea culpa) une ligne de code... :
SUPPRIME (ou "commente" *) aussi cette :evilred: ligne !!Code:
1
2
3
4 function table_thead_fixed() { ... table_thead_fixed_resize(); }
*
Code:
1
2
3
4 function table_thead_fixed() { ... // table_thead_fixed_resize(); }
Bon plus d'erreurs en console mais le thead fixe et tbody scroll ne fonctionne pas... :weird:
Sur l'onglet Race log, je ne peux pas tester car il faut que ça se remplisse (et ça prends du temps une ligne toutes les 5 min) en revanche sur l'onglet Friends/Opponents ça devrait fonctionner mais rien c'est comme si j'avais rien fait (aucun code) car le comportement est identique à avant.
En épluchant le code HTML je m'aperçois que les div ne sont pas crées.
Dans mon autre extension j'arrive a les visualiser dans l'inspecteur.