From 27f4766f10a82a3711c52e4143d3e1d72eef6e37 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 20 Feb 2025 15:50:02 +1100 Subject: [PATCH] allow passing of options into display class to remove hardcoding in html template, to support more than one select/drop-down. Also, made chaning the future for the ioniq6 payouts toggle appropiate buyout/lease vars to be readonly --- templates/index.html | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/templates/index.html b/templates/index.html index 66aa910..25bfda9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -32,18 +32,17 @@ {% endif %}
- - {% elif el.display=="date" %} @@ -157,6 +156,23 @@ window.onload = function() { $('#Sell_shares').val( {{finance['Sell_shares']}} ) $('#compare_to').val( {{finance['compare_to']}} ) + $('#Ioniq6_future').val( {{finance['Ioniq6_future']}} ) + + if( $("#Ioniq6_future option:selected"). text() == 'lease' ) + { + // disable buyout + $('#lbl-Car_buyout').addClass('bg-light text-secondary border-secondary') + $('#Car_buyout').addClass('bg-light text-secondary border-secondary').attr('readonly', 'readonly' ) + $('#Car_buyout_date').addClass('bg-light text-secondary border-secondary').attr('readonly', 'readonly' ) + } + else + { + // disable lease + $('#lbl-Car_loan').addClass('bg-light text-secondary') + $('#Car_loan').addClass('bg-light text-secondary') + $('#lbl-Car_balloon').addClass('bg-light text-secondary') + $('#Car_balloon').addClass('bg-light text-secondary') + } var tooltipTriggerList = [].slice.call(document.querySelectorAll("[data-bs-toggle='tooltip']")) var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl) })