From f502e5952e5db816afe3b1aa5d14af466ec80978 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 25 May 2016 12:00:37 +0300 Subject: [PATCH] Lazy load invoice documents --- resources/views/invoices/edit.blade.php | 92 ++++++++++++++----------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 4f1d96f20a..723d2e5c3a 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -974,47 +974,59 @@ }) // Initialize document upload - dropzone = new Dropzone('#document-upload .dropzone', { - url:{!! json_encode(url('document')) !!}, - params:{ - _token:"{{ Session::getToken() }}" - }, - acceptedFiles:{!! json_encode(implode(',',\App\Models\Document::$allowedMimes)) !!}, - addRemoveLinks:true, - @foreach(trans('texts.dropzone') as $key=>$text) - "dict{{strval($key)}}":"{{strval($text)}}", - @endforeach - maxFileSize:{{floatval(MAX_DOCUMENT_SIZE/1000)}}, - }); - if(dropzone instanceof Dropzone){ - dropzone.on("addedfile",handleDocumentAdded); - dropzone.on("removedfile",handleDocumentRemoved); - dropzone.on("success",handleDocumentUploaded); - for (var i=0; i