File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,11 +201,10 @@ function updateStyles(style = null) {
201201 } ) ;
202202}
203203
204- function gen_label ( print = false , cut_once = false ) {
204+ function gen_label ( preview = true , cut_once = false ) {
205205 // Check label against installed label in the printer
206206 updatePrinterStatus ( ) ;
207207
208- const preview = ! print ;
209208 if ( preview )
210209 {
211210 // Update preview image based on label size
@@ -240,13 +239,13 @@ function gen_label(print = false, cut_once = false) {
240239
241240 // Process image upload
242241 if ( $ ( 'input[name=printType]:checked' ) . val ( ) == 'image' ) {
243- dropZoneMode = 'preview' ;
242+ dropZoneMode = preview ? 'preview' : 'print ';
244243 imageDropZone . processQueue ( ) ;
245244 return ;
246245 }
247246
248247 // Send printing request
249- const url = preview ? url_for_get_preview + '?return_format=base64' : url_for_print_label ;
248+ const url = preview ? ( url_for_get_preview + '?return_format=base64' ) : url_for_print_label ;
250249 $ . ajax ( {
251250 type : 'POST' ,
252251 url : url ,
@@ -265,11 +264,11 @@ function gen_label(print = false, cut_once = false) {
265264}
266265
267266function print ( cut_once = false ) {
268- gen_label ( true , cut_once ) ;
267+ gen_label ( false , cut_once ) ;
269268}
270269
271270function preview ( ) {
272- gen_label ( false ) ;
271+ gen_label ( true ) ;
273272}
274273
275274function setStatus ( data , what = null ) {
You can’t perform that action at this time.
0 commit comments