changes to the way the qrcode button is placed from the previous commeit

This commit is contained in:
OutCast3k 2015-06-22 10:41:21 +00:00
parent d81f2779a9
commit d4772fd601
2 changed files with 17 additions and 14 deletions

View file

@ -536,14 +536,12 @@
<div id="transactionCreate" class="alert alert-success hidden">
<label>Transaction</label>
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode" style="float:right;"><span class="glyphicon glyphicon-qrcode"></span></button>
<p>The transaction below has been generated and encoded. It can be broadcasted once it has been signed.</p>
<br>
<div class="input-group">
<textarea class="form-control" style="height:150px" readonly></textarea>
<span class="input-group-btn">
<button class="qrcodeBtn btn btn-default" type="button" data-toggle="modal" data-target="#modalQrcode"><span class="glyphicon glyphicon-qrcode"></span></button>
</span>
</div>
<textarea class="form-control" style="height:150px" readonly></textarea>
<p class="text-muted">Size: <span class="txSize">0</span> <i>bytes</i></p>
</div>

View file

@ -929,19 +929,24 @@ $(document).ready(function() {
$(".qrcodeBtn").click(function(){
$("#qrcode").html("");
var thisbtn = $(this).parent().parent();
if($('textarea',$(this).closest('.input-group')).length){
var qrcode = new QRCode("qrcode",{width:512,height:512});
var qrstr = $('textarea',$(this).closest('.input-group')).val();
var qrstr = false;
var ta = $("textarea",thisbtn);
if(ta.length>0){
var w = (screen.availWidth > screen.availHeight ? screen.availWidth : screen.availHeight)/3;
var qrcode = new QRCode("qrcode", {width:w, height:w});
qrstr = $(ta).val();
if(qrstr.length > 2000){
$("#qrcode").html("<p>Sorry the data is too long for the QR generator.</p>");
return;
}
}else{
} else {
var qrcode = new QRCode("qrcode");
var qrstr = "bitcoin:"+$('.address',thisbtn).val();
qrstr = "bitcoin:"+$('.address',thisbtn).val();
}
if(qrstr){
qrcode.makeCode(qrstr);
}
qrcode.makeCode(qrstr);
});
$('input[title!=""], abbr[title!=""]').tooltip({'placement':'bottom'});