fixed bug where insert cset did not show it in menu until a full reload

This commit is contained in:
2026-02-11 12:02:09 +11:00
parent f0fee15548
commit b8c1edc084
3 changed files with 19 additions and 13 deletions

View File

@@ -230,7 +230,12 @@
$(function() { $('[data-bs-toggle="popover"]').popover(); });
window.onload = function() {
$('#Sell_shares').val( {{finance['Sell_shares']}} )
$('#compare_to').val( {{finance['compare_to']}} )
{% if finance['compare_to'] %}
$('#compare_to').val( {{finance['compare_to']}} )
{% else %}
// set this to Nothing by default
$('#compare_to').val( 0 )
{% endif %}
$('#Ioniq6_future').val( {{finance['Ioniq6_future']}} )
if( $("#Ioniq6_future option:selected"). text() == 'lease' )
@@ -434,13 +439,17 @@
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-info"
onClick="
vars['name']=$('#save_name').val();
$.ajax( {
type: 'POST',
url: '/save',
vars['name'] = $('#save_name').val();
$.ajax({
type: 'POST',
url: '/save',
contentType: 'application/json',
data: JSON.stringify( { 'vars': vars, 'savings_data' :savingsData } ),
success: function() { $('#save_modal').modal('hide'); } } )"
data: JSON.stringify({ 'vars': vars, 'savings_data': savingsData }),
success: function(resp) {
$('#save_modal').modal('hide');
$('#compare_to').append($('<option>', { value: resp.cset_id, text: resp.name }));
}
});"
>Save</button>
</div>
</div>