Add Spinner
This commit is contained in:
@@ -31,9 +31,11 @@ let createMasterFilterFrame=()=>{
|
|||||||
|
|
||||||
<h2 id='tbSelectedTime'></h2>
|
<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.
|
let _filterContext={}; // TODO: This is bad, grown design - should be replaced with a proper object oriented structure and observer pattern.
|
||||||
Object.defineProperty(me,"selectedDate",{
|
Object.defineProperty(me,"selectedDate",{
|
||||||
get:_=>{ return (_filterContext.theDate);}
|
get:_=>{ return (_filterContext.theDate);}
|
||||||
@@ -123,11 +125,13 @@ let createMasterFilterFrame=()=>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
me.requestOptionChain=()=>{
|
me.requestOptionChain=()=>{
|
||||||
|
$("#spinner").show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"/getOptionChain?Date=" + _filterContext.theDate + "&Symbol=" + _filterContext.theSymbol + "&Time="+ _filterContext.selectedTime
|
url:"/getOptionChain?Date=" + _filterContext.theDate + "&Symbol=" + _filterContext.theSymbol + "&Time="+ _filterContext.selectedTime
|
||||||
}).done(response=>{
|
}).done(response=>{
|
||||||
dta=JSON.parse(response[0].Data);
|
dta=JSON.parse(response[0].Data);
|
||||||
//console.log("received",dta);
|
//console.log("received",dta);
|
||||||
|
$("#spinner").hide();
|
||||||
displayOptionChain();
|
displayOptionChain();
|
||||||
$("#tbUnderlyingPrice").text(dta.underlyingPrice.toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
$("#tbUnderlyingPrice").text(dta.underlyingPrice.toLocaleString('en',{minimumFractionDigits: 2, maximumFractionDigits: 2}));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user