1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 09:04:35 +01:00

bug fixes

This commit is contained in:
Hillel Coren 2014-02-18 15:20:12 +02:00
parent b89b1eb45e
commit f9e7959218
2 changed files with 8 additions and 1 deletions

View File

@ -11,7 +11,7 @@
{{ $totalIncome }} {{ $totalIncome }}
</div> </div>
<div class="in-thin"> <div class="in-thin">
in total income in total revenue
</div> </div>
</div> </div>
</div> </div>

View File

@ -469,6 +469,7 @@
var $input = $('select#client'); var $input = $('select#client');
$input.combobox().on('change', function(e) { $input.combobox().on('change', function(e) {
var clientId = parseInt($('input[name=client]').val(), 10); var clientId = parseInt($('input[name=client]').val(), 10);
console.log('CHANGE: %s', clientId);
if (clientId > 0) { if (clientId > 0) {
model.loadClient(clientMap[clientId]); model.loadClient(clientMap[clientId]);
} else { } else {
@ -580,6 +581,7 @@
*/ */
var isRefreshing = false; var isRefreshing = false;
var needsRefresh = false;
function refreshPDF() { function refreshPDF() {
var invoice = createInvoiceModel(); var invoice = createInvoiceModel();
var doc = generatePDF(invoice); var doc = generatePDF(invoice);
@ -590,6 +592,7 @@
$('#theFrame').attr('src', string).show(); $('#theFrame').attr('src', string).show();
} else { } else {
if (isRefreshing) { if (isRefreshing) {
needsRefresh = true;
return; return;
} }
isRefreshing = true; isRefreshing = true;
@ -609,6 +612,10 @@
page.render({canvasContext: context, viewport: viewport}); page.render({canvasContext: context, viewport: viewport});
$('#theCanvas').show(); $('#theCanvas').show();
isRefreshing = false; isRefreshing = false;
if (needsRefresh) {
needsRefresh = false;
refreshPDF();
}
}); });
}); });
} }