From 9f3d6ed6d046132f35e96b3eea87a1457764eaa1 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 14 Nov 2020 15:57:42 +0100 Subject: [PATCH] =?UTF-8?q?Afficher=20des=20colonnes=20pour=20difficult?= =?UTF-8?q?=C3=A9=20extr=C3=A8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-resolution-table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index d10b16f5..8286f633 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -160,10 +160,11 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static _buildHTMLTable(caracValue, levelValue, minCarac, maxCarac, minLevel, maxLevel) { + let countColonnes = maxLevel - minLevel; minCarac = Math.max(minCarac, 1); maxCarac = Math.min(maxCarac, 30); minLevel = Math.max(minLevel, -10); - maxLevel = Math.min(maxLevel, 22); + maxLevel = Math.max(Math.min(maxLevel, 22), minLevel + countColonnes); let table = $("") .append(this._buildHTMLHeader(this.resolutionTable[0], minLevel, maxLevel)); @@ -176,7 +177,6 @@ export class RdDResolutionTable { static _buildHTMLHeader(dataRow, minLevel, maxLevel) { let tr = $(""); - let max = maxLevel; if (minLevel > -8) { tr.append($("
").text("-8")) @@ -184,7 +184,7 @@ export class RdDResolutionTable { if (minLevel > -7) { tr.append($("").text("...")); } - for (let difficulte = minLevel; difficulte <= max; difficulte++) { + for (let difficulte = minLevel; difficulte <= maxLevel; difficulte++) { const niveau = dataRow[difficulte + 10].niveau; const txt = (niveau > 0 ? "+" : "") + niveau; tr.append($("").text(txt));