mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Automatically disable live preview when using a large font
This commit is contained in:
parent
9f5fe33059
commit
cd52faa3bf
@ -820,6 +820,18 @@ class AccountController extends BaseController
|
||||
$account->page_size = Input::get('page_size');
|
||||
$account->live_preview = Input::get('live_preview') ? true : false;
|
||||
|
||||
// Automatically disable live preview when using a large font
|
||||
$fonts = Cache::get('fonts')->filter(function($font) use ($account) {
|
||||
if ($font->google_font) {
|
||||
return false;
|
||||
}
|
||||
return $font->id == $account->header_font_id || $font->id == $account->body_font_id;
|
||||
});
|
||||
if ($account->live_preview && count($fonts)) {
|
||||
$account->live_preview = false;
|
||||
Session::flash('warning', trans('texts.live_preview_disabled'));
|
||||
}
|
||||
|
||||
$labels = [];
|
||||
foreach (['item', 'description', 'unit_cost', 'quantity', 'line_total', 'terms', 'balance_due', 'partial_due'] as $field) {
|
||||
$labels[$field] = Input::get("labels_{$field}");
|
||||
|
@ -1129,6 +1129,7 @@ $LANG = array(
|
||||
|
||||
'live_preview' => 'Live Preview',
|
||||
'page_size' => 'Page Size',
|
||||
'live_preview_disabled' => 'Live preview has been disabled to support selected font',
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
Loading…
x
Reference in New Issue
Block a user