1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Prevent numbers from wrapping

This commit is contained in:
Hillel Coren 2017-08-23 21:53:45 +03:00
parent f95cdd2c32
commit 6d9e4cfe1d
3 changed files with 40 additions and 31 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -145,6 +145,9 @@ function GetPdfMake(invoice, javascript, callback) {
}
}
// support setting noWrap as a style
dd.styles.noWrap = {'noWrap': true};
// set page size
dd.pageSize = invoice.account.page_size;
@ -1101,11 +1104,17 @@ NINJA.prepareDataPairs = function(oldData, section) {
}
NINJA.processItem = function(item, section) {
if (item.style && item.style instanceof Array) {
item.style.push(section);
} else {
item.style = [section];
if (! item.style) {
item.style = [];
}
item.style.push(section);
// make sure numbers aren't wrapped
if (item.text && item.text.match && item.text.match(/\d\.\d\d|\d,\d\d/)) {
item.style.push('noWrap');
}
return item;
}