Skip to content

Commit a82e1cc

Browse files
committed
1.1
1 parent ead06b2 commit a82e1cc

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

resources/assets/component.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function componentLine(name,columns,data) {
301301
dom.getElementsByClassName('JsonTableInsert')[0].appendChild(i);
302302
}
303303

304-
function componentPlane(url,xhr_url='',method='POST'){
304+
function componentPlane(url,xhr_url='',method='POST',callback=null){
305305
if(xhr_url==''){
306306
xhr_url = url;
307307
}
@@ -342,6 +342,10 @@ function componentPlane(url,xhr_url='',method='POST'){
342342
let formdata = new FormData(form);
343343

344344
_componentMegaBlock._request(xhr_url,method,formdata,function (response) {
345+
if(typeof callback == 'function'){
346+
callback(response);
347+
return;
348+
}
345349
if(response.code == 0) {
346350
window.location.reload();
347351
}else{
@@ -386,14 +390,14 @@ function componentPlane(url,xhr_url='',method='POST'){
386390
this._modalBodyNode.append(loading);
387391
},
388392
_createModal: function () {
389-
//modal
393+
/*modal*/
390394
let modal = document.createElement("div");
391395
modal.setAttribute('class', 'modal grid-modal in');
392396
modal.setAttribute('tabindex', '-1');
393397
modal.setAttribute('role', 'dialog');
394398
modal.style = 'display: block;';
395399

396-
//modal_dialog
400+
/*modal_dialog*/
397401
let mod_dialog = document.createElement("div");
398402
mod_dialog.setAttribute('class', 'modal-dialog modal-lg');
399403
mod_dialog.setAttribute('role', 'document');
@@ -402,11 +406,11 @@ function componentPlane(url,xhr_url='',method='POST'){
402406
let modal_content = document.createElement("div");
403407
modal_content.className = "modal-content";
404408

405-
//header
409+
/*header*/
406410
let modal_header = document.createElement("div");
407411
modal_header.className = 'modal-header';
408412
modal_header.style = 'background-color:#ffffff;padding: 3px;display: flex;justify-content:flex-end;';
409-
//X
413+
/*X*/
410414
let X = document.createElement('i');
411415
X.setAttribute('class', 'fa fa-close');
412416
X.setAttribute('style', 'cursor: pointer');
@@ -424,7 +428,7 @@ function componentPlane(url,xhr_url='',method='POST'){
424428

425429
this._modalBodyNode = modal_body;
426430
this._loading();
427-
//create modal
431+
/*create modal*/
428432
modal_header.append(X);
429433
modal_content.append(modal_header);
430434
modal_content.append(modal_body);
@@ -434,8 +438,4 @@ function componentPlane(url,xhr_url='',method='POST'){
434438
}
435439
};
436440
Form.make(url)
437-
}
438-
439-
440-
441-
441+
}

resources/assets/component.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)