From a0960420de647c756a163df20f16742202a8e790 Mon Sep 17 00:00:00 2001 From: schnibble Date: Wed, 14 Dec 2016 20:50:19 +0300 Subject: [PATCH] fixed an issue with incorrect first input removing on the tranasaction tab --- js/coinbin.js | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/js/coinbin.js b/js/coinbin.js index 0e6565d9..24f1d40c 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -579,8 +579,28 @@ $(document).ready(function() { }); $(".txidClear").click(function(){ - $("#inputs .row:first input").attr('disabled',false); - $("#inputs .row:first input").val(""); + if ($("#inputs > div").length == 1) + { + $("#inputs .row:first input").attr('disabled',false); + $("#inputs .row:first input").val(""); + } + else + { + $.each($("#inputs .row"), function(i,o){ + if ($(o).is(':last-child')) + { + o.remove(); + return true; + } + var next = $(o).next(); + $(".txId",o).val($(".txId",next).val()); + $(".txIdScript",o).val($(".txIdScript",next).val()); + $(".txIdN",o).val($(".txIdN",next).val()); + $(".txIdAmount",o).val($(".txIdAmount",next).val()); + $("input",o).attr('disabled',$("input",next).prop('disabled')); + }); + } + totalInputAmount(); }); @@ -673,7 +693,8 @@ $(document).ready(function() { } if($("#clearInputsOnLoad").is(":checked")){ - $("#inputs .txidRemove, #inputs .txidClear").click(); + $("#inputs .txidRemove").click(); + $("#inputs .txidClear").click(); } $("#redeemFromBtn").html("Please wait, loading...").attr('disabled',true);