@@ -301,7 +301,7 @@ function componentLine(name,columns,data) {
301
301
dom . getElementsByClassName ( 'JsonTableInsert' ) [ 0 ] . appendChild ( i ) ;
302
302
}
303
303
304
- function componentPlane ( url , xhr_url = '' , method = 'POST' ) {
304
+ function componentPlane ( url , xhr_url = '' , method = 'POST' , callback = null ) {
305
305
if ( xhr_url == '' ) {
306
306
xhr_url = url ;
307
307
}
@@ -342,6 +342,10 @@ function componentPlane(url,xhr_url='',method='POST'){
342
342
let formdata = new FormData ( form ) ;
343
343
344
344
_componentMegaBlock . _request ( xhr_url , method , formdata , function ( response ) {
345
+ if ( typeof callback == 'function' ) {
346
+ callback ( response ) ;
347
+ return ;
348
+ }
345
349
if ( response . code == 0 ) {
346
350
window . location . reload ( ) ;
347
351
} else {
@@ -386,14 +390,14 @@ function componentPlane(url,xhr_url='',method='POST'){
386
390
this . _modalBodyNode . append ( loading ) ;
387
391
} ,
388
392
_createModal : function ( ) {
389
- // modal
393
+ /* modal*/
390
394
let modal = document . createElement ( "div" ) ;
391
395
modal . setAttribute ( 'class' , 'modal grid-modal in' ) ;
392
396
modal . setAttribute ( 'tabindex' , '-1' ) ;
393
397
modal . setAttribute ( 'role' , 'dialog' ) ;
394
398
modal . style = 'display: block;' ;
395
399
396
- // modal_dialog
400
+ /* modal_dialog*/
397
401
let mod_dialog = document . createElement ( "div" ) ;
398
402
mod_dialog . setAttribute ( 'class' , 'modal-dialog modal-lg' ) ;
399
403
mod_dialog . setAttribute ( 'role' , 'document' ) ;
@@ -402,11 +406,11 @@ function componentPlane(url,xhr_url='',method='POST'){
402
406
let modal_content = document . createElement ( "div" ) ;
403
407
modal_content . className = "modal-content" ;
404
408
405
- // header
409
+ /* header*/
406
410
let modal_header = document . createElement ( "div" ) ;
407
411
modal_header . className = 'modal-header' ;
408
412
modal_header . style = 'background-color:#ffffff;padding: 3px;display: flex;justify-content:flex-end;' ;
409
- //X
413
+ /*X*/
410
414
let X = document . createElement ( 'i' ) ;
411
415
X . setAttribute ( 'class' , 'fa fa-close' ) ;
412
416
X . setAttribute ( 'style' , 'cursor: pointer' ) ;
@@ -424,7 +428,7 @@ function componentPlane(url,xhr_url='',method='POST'){
424
428
425
429
this . _modalBodyNode = modal_body ;
426
430
this . _loading ( ) ;
427
- // create modal
431
+ /* create modal*/
428
432
modal_header . append ( X ) ;
429
433
modal_content . append ( modal_header ) ;
430
434
modal_content . append ( modal_body ) ;
@@ -434,8 +438,4 @@ function componentPlane(url,xhr_url='',method='POST'){
434
438
}
435
439
} ;
436
440
Form . make ( url )
437
- }
438
-
439
-
440
-
441
-
441
+ }
0 commit comments