Skip to content

Commit a096042

Browse files
author
schnibble
committed
fixed an issue with incorrect first input removing on the tranasaction tab
1 parent 20547ff commit a096042

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

js/coinbin.js

+24-3
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,28 @@ $(document).ready(function() {
579579
});
580580

581581
$(".txidClear").click(function(){
582-
$("#inputs .row:first input").attr('disabled',false);
583-
$("#inputs .row:first input").val("");
582+
if ($("#inputs > div").length == 1)
583+
{
584+
$("#inputs .row:first input").attr('disabled',false);
585+
$("#inputs .row:first input").val("");
586+
}
587+
else
588+
{
589+
$.each($("#inputs .row"), function(i,o){
590+
if ($(o).is(':last-child'))
591+
{
592+
o.remove();
593+
return true;
594+
}
595+
var next = $(o).next();
596+
$(".txId",o).val($(".txId",next).val());
597+
$(".txIdScript",o).val($(".txIdScript",next).val());
598+
$(".txIdN",o).val($(".txIdN",next).val());
599+
$(".txIdAmount",o).val($(".txIdAmount",next).val());
600+
$("input",o).attr('disabled',$("input",next).prop('disabled'));
601+
});
602+
}
603+
584604
totalInputAmount();
585605
});
586606

@@ -673,7 +693,8 @@ $(document).ready(function() {
673693
}
674694

675695
if($("#clearInputsOnLoad").is(":checked")){
676-
$("#inputs .txidRemove, #inputs .txidClear").click();
696+
$("#inputs .txidRemove").click();
697+
$("#inputs .txidClear").click();
677698
}
678699

679700
$("#redeemFromBtn").html("Please wait, loading...").attr('disabled',true);

0 commit comments

Comments
 (0)