Skip to content

Commit af0cdef

Browse files
committed
Fix a minor bug in the decay chain box.
1 parent d8173ac commit af0cdef

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

online/radioactive-decay.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,13 @@ <h2>Notes:</h2>
954954

955955
$("#info-id").html(`<i class="fa-solid fa-square" style="color: #4690F2; font-size: 14px;"></i> Admet comme nom complet du noyau résultant: <span style="font-weight: bold; color: #DC3545;">${getElementNameWithSymbol(lastNucleus.element)}</span>`);
956956

957-
if ($(".website-bottom .chain-btn").length > 0 && isDecayChain === false) $(".website-bottom .chain-btn").remove();
957+
if ($(".website-bottom .chain-btn").length > 0 && isDecayChain === false) {
958+
959+
Object.assign(extendedData, { chain_equations_html: '', elements_names_chain_html: '', elements_masses_chain_html: '' });
960+
961+
$(".website-bottom .chain-btn").remove();
962+
963+
}
958964

959965
constructHTML();
960966

@@ -964,6 +970,8 @@ <h2>Notes:</h2>
964970

965971
function getChainElements() {
966972

973+
if (extendedData.chain_equations_html === '' || extendedData.elements_names_chain_html === '' || extendedData.elements_masses_chain_html === '') return;
974+
967975
$("#chain-equations").html(extendedData.chain_equations_html);
968976

969977
$("#chain-elements-names").html(extendedData.elements_names_chain_html)
@@ -982,7 +990,7 @@ <h2>Notes:</h2>
982990

983991
if ($(".website-bottom .chain-btn").length > 0) $(".website-bottom .chain-btn").remove();
984992

985-
if ($(window).width() >= 1024) $(".website-bottom").append(`<a class="chain-btn" onclick="getChainElements();"><i class="fa-solid fa-list"></i> Voir la chaîne de désintégration</a>`);
993+
if ($(window).width() >= 1024) $(".website-bottom").append(`<a class="chain-btn" onclick="getChainElements();"><i class="fa-solid fa-list"></i> Chaîne de désintégration</a>`);
986994

987995
else $(".website-bottom").append(`<a class="chain-btn" onclick="getChainElements();"><i class="fa-solid fa-list"></i> </a>`);
988996

0 commit comments

Comments
 (0)