Add Spinner

This commit is contained in:
Joe Tretter
2020-05-08 13:50:58 -05:00
parent 881d84fd9c
commit d1521c9e9f

View File

@@ -31,9 +31,11 @@ let createMasterFilterFrame=()=>{
<h2 id='tbSelectedTime'></h2>
<!--button onclick='rq()'>LOAD</button-->
<div id='spinner' style='z-index:100; position:absolute;display:none'>
<h1 style='color:red'>*</h1>
</div>
`;
let _filterContext={}; // TODO: This is bad, grown design - should be replaced with a proper object oriented structure and observer pattern.
Object.defineProperty(me,"selectedDate",{
get:_=>{ return (_filterContext.theDate);}
@@ -123,11 +125,13 @@ let createMasterFilterFrame=()=>{
}
me.requestOptionChain=()=>{
$("#spinner").show();
$.ajax({
url:"/getOptionChain?Date=" + _filterContext.theDate + "&Symbol=" + _filterContext.theSymbol + "&Time="+ _filterContext.selectedTime
}).done(response=>{
dta=JSON.parse(response[0].Data);
//console.log("received",dta);
$("#spinner").hide();
displayOptionChain();
$("#tbUnderlyingPrice").text(dta.underlyingPrice.toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2}));
});