|
|
|
@ -10,7 +10,6 @@ const layout={'autosize': true, 'markers':true, |
|
|
|
|
} |
|
|
|
|
// Cache frequently-used DOM elements
|
|
|
|
|
const $stockForm = $('#stock-form'); |
|
|
|
|
// const $stockSelect = $('#stock-select');
|
|
|
|
|
const $compSelect = $('#competition'); |
|
|
|
|
const $stockList = $('#stock-list'); |
|
|
|
|
const $submitBtn = $('#submit-btn'); |
|
|
|
@ -32,7 +31,14 @@ function addStockItem(stock, text) { |
|
|
|
|
</li>`); |
|
|
|
|
$stockList.append($newItem); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function changeFunc(value) { |
|
|
|
|
console.log(value); |
|
|
|
|
if (value === 'quadratic_utility') { |
|
|
|
|
$('#gamma').css("display", "flex"); |
|
|
|
|
} else { |
|
|
|
|
$('#gamma').css("display", "none"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// Function to delete a stock item from the list
|
|
|
|
|
function deleteStockItem(itemIndex) { |
|
|
|
|
// Remove item from array
|
|
|
|
@ -48,17 +54,6 @@ $stockList.on('click', '.delete-btn', function(){ |
|
|
|
|
deleteStockItem(itemIndex); |
|
|
|
|
// console.log(stockList);
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function changeFunc(value) { |
|
|
|
|
console.log(value); |
|
|
|
|
if (value === 'quadratic_utility') { |
|
|
|
|
$('#gamma').css("display", "flex"); |
|
|
|
|
} else { |
|
|
|
|
$('#gamma').css("display", "none"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Event listener for submit button click
|
|
|
|
|
$addStockBtn.click(function(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
@ -171,10 +166,3 @@ $(document).ready(function(){ |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// window.onresize = function() {
|
|
|
|
|
// Plotly.relayout('graph', {
|
|
|
|
|
// 'xaxis.autorange': true,
|
|
|
|
|
// 'yaxis.autorange': true
|
|
|
|
|
// });
|
|
|
|
|
// };
|
|
|
|
|