|
|
|
@@ -9,6 +9,17 @@ let createOrderFrame=()=>{
|
|
|
|
<div id='lbCostAmount'>0</div>
|
|
|
|
<div id='lbCostAmount'>0</div>
|
|
|
|
<ul id='listOrderItems'>
|
|
|
|
<ul id='listOrderItems'>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="wrapper" id="frmChangePrice" style="display:none">
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
|
|
|
|
<span class="input-group-addon">$</span>
|
|
|
|
|
|
|
|
<input type="text" class="form-control" id='changePriceValue' aria-label="Amount (to the nearest dollar)">
|
|
|
|
|
|
|
|
<span class="input-group-addon">.00</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="text-align:right">
|
|
|
|
|
|
|
|
<button class="btn btn-success" type="button" onclick='$("#frmChangePrice").data("targetLine").changePrice($("#changePriceValue").val()/100);$(frmChangePrice).hide();'>OK</button>
|
|
|
|
|
|
|
|
<button class="btn btn-primary" type="button" onclick='$(frmChangePrice).hide();'>CANCEL</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
$('#app').append(me);
|
|
|
|
$('#app').append(me);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -32,6 +43,7 @@ let createOrderFrame=()=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (me.getElementsByClassName("quantity")[0] !== undefined) {
|
|
|
|
if (me.getElementsByClassName("quantity")[0] !== undefined) {
|
|
|
|
me.getElementsByClassName("quantity")[0].innerText = me.quantity;
|
|
|
|
me.getElementsByClassName("quantity")[0].innerText = me.quantity;
|
|
|
|
|
|
|
|
me.getElementsByClassName("singlePrice")[0].innerText = me.singleCostAmount.toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2}).padStart(7,"\xa0");
|
|
|
|
me.getElementsByClassName("totalCost")[0].innerText = me.totalCostAmount.toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2});
|
|
|
|
me.getElementsByClassName("totalCost")[0].innerText = me.totalCostAmount.toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@@ -49,6 +61,19 @@ let createOrderFrame=()=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
me.displayFrmPriceChange=_=>{
|
|
|
|
|
|
|
|
$("#changePriceValue").val(parseInt(me.price*100,10));
|
|
|
|
|
|
|
|
let clickElePos=$(event.target).position();
|
|
|
|
|
|
|
|
$("#frmChangePrice").css("left",clickElePos.left).css("top",clickElePos.top);
|
|
|
|
|
|
|
|
$("#frmChangePrice").data('targetLine',event.target.parentElement);
|
|
|
|
|
|
|
|
$("#frmChangePrice").show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
me.changePrice=newPrice=>{
|
|
|
|
|
|
|
|
me.price=newPrice;
|
|
|
|
|
|
|
|
me.updateNumbers();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
me.removeFromOrder=_=>{
|
|
|
|
me.removeFromOrder=_=>{
|
|
|
|
me.quantity=0;
|
|
|
|
me.quantity=0;
|
|
|
|
me.updateNumbers();
|
|
|
|
me.updateNumbers();
|
|
|
|
@@ -70,12 +95,13 @@ let createOrderFrame=()=>{
|
|
|
|
let optionDetails=splitOptionDetails(optionData.symbol);
|
|
|
|
let optionDetails=splitOptionDetails(optionData.symbol);
|
|
|
|
|
|
|
|
|
|
|
|
me.innerHTML=`
|
|
|
|
me.innerHTML=`
|
|
|
|
<a class='danger' onclick='this.parentElement.removeFromOrder();'>[X]</a> <b>${myMasterFilter.selectedDate}|${myMasterFilter.selectedTime.substr(0,5)}</b>|<span class="opentype${openType}">${((openType==="buy")?" ":"") + openType}</span>@<span class="singlePrice">${Math.abs(me.singleCostAmount).toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2}).padStart(7,"\xa0")}</span>|<span class='quantity'>${me.quantity}</span>
|
|
|
|
<a class='danger' onclick='this.parentElement.removeFromOrder();'>[X]</a><b>${myMasterFilter.selectedDate}|${myMasterFilter.selectedTime.substr(0,5)}</b>|<span class="opentype${openType}">${((openType==="buy")?" ":"") + openType}</span><span class='plusMinus' onclick='this.parentElement.displayFrmPriceChange();'>@</span><span class="singlePrice">${Math.abs(me.singleCostAmount).toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2}).padStart(7,"\xa0")}</span>|<span class='quantity'>${me.quantity}</span>
|
|
|
|
<div class='plusMinusContainer'>
|
|
|
|
<div class='plusMinusContainer'>
|
|
|
|
<a class='plusMinus' onclick='this.parentElement.parentElement.increaseQty();'>[+]</a><a class='plusMinus' onclick='this.parentElement.parentElement.decreaseQty();'>[-]</a>
|
|
|
|
<a class='plusMinus' onclick='this.parentElement.parentElement.increaseQty();'>[+]</a><a class='plusMinus' onclick='this.parentElement.parentElement.decreaseQty();'>[-]</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='orderItemLine2'>
|
|
|
|
<div class='orderItemLine2'>
|
|
|
|
${optionDetails.symbol} ${optionDetails.date} ${optionDetails.putCall} ${optionDetails.strike} => <span class='totalCost'>${me.totalCostAmount.toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2})}</span>
|
|
|
|
${optionDetails.symbol} ${optionDetails.date} ${optionDetails.putCall} ${optionDetails.strike} =>
|
|
|
|
|
|
|
|
<span class='totalCost'>${me.totalCostAmount.toLocaleString('en',{minimumFractionDigits: 0, maximumFractionDigits: 2})}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
|