@@ -60,7 +60,10 @@ class ComponentDot {
60
60
let select_str = JSON . stringify ( this . select_data ) ;
61
61
this . insert_data = [ ] ;
62
62
this . delete_data = [ ] ;
63
- let html = `<div style="width: 100%;height:100%;display: grid; grid-template-rows: 42px auto;border: 1px solid #ccc;border-radius: 5px">
63
+ let html = `<style>#${ name } -select::-webkit-scrollbar,#${ name } -content::-webkit-scrollbar{width: 4px;height: 4px;}
64
+ #${ name } -select::-webkit-scrollbar-thumb,#${ name } -content::-webkit-scrollbar-thumb {border-radius: 5px;-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);background: rgba(0,0,0,0.2);}
65
+ #${ name } -select::-webkit-scrollbar-track,#${ name } -content::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);border-radius: 0;background: rgba(0,0,0,0.1);}</style>
66
+ <div style="width: 100%;height:100%;display: grid; grid-template-rows: 42px auto;border: 1px solid #ccc;border-radius: 5px">
64
67
<div style="display:flex;background: #e1ffa8bf;"><div style="width:120px;background: #e1ffa8bf;">
65
68
<input id="${ name } -search" type="text" class="form-control" placeholder="搜索名称"></div>
66
69
<div id="${ name } -select" style="width:100%;overflow: auto;border-bottom: 1px solid #ccc;padding: 3px;border-radius: 0 0 0 14px;background: #ffffffbf;">${ selected_dom } </div>
@@ -384,47 +387,28 @@ class ComponentPlane {
384
387
}
385
388
386
389
makeModal ( ) {
387
- /*modal*/
388
- let modal = document . createElement ( "div" ) ;
389
- modal . setAttribute ( 'class' , 'modal grid-modal in' ) ;
390
- modal . setAttribute ( 'tabindex' , '-1' ) ;
391
- modal . setAttribute ( 'role' , 'dialog' ) ;
392
- modal . style = 'display: block;' ;
393
- /*modal_dialog*/
394
- let mod_dialog = document . createElement ( "div" ) ;
395
- mod_dialog . setAttribute ( 'class' , 'modal-dialog modal-lg' ) ;
396
- mod_dialog . setAttribute ( 'role' , 'document' ) ;
397
- mod_dialog . style = `width:${ window . innerWidth * this . OPTIONS . W } px` ;
398
- /*modal_content*/
399
- let modal_content = document . createElement ( "div" ) ;
400
- modal_content . className = "modal-content" ;
401
- /*header*/
402
- let modal_header = document . createElement ( "div" ) ;
403
- modal_header . className = 'modal-header' ;
404
- modal_header . style = 'background-color:#ffffff;padding: 3px;display: flex;justify-content:flex-end;' ;
390
+ console . log ( this . OPTIONS . W )
391
+ let html = `<div id="dlp" class="modal" style="display: block;">
392
+ <div class="modal-dialog modal-lg" style="width: ${ window . innerWidth * this . OPTIONS . W } px;">
393
+ <div class="modal-content">
394
+ <div class="modal-header" style="background-color: rgb(255, 255, 255); padding: 3px; display: flex; justify-content: flex-end;"></div>
395
+ <div class="modal-body" style="background-color: rgb(244, 244, 244); padding: 0px; overflow-y: auto; max-height:${ window . innerHeight * this . OPTIONS . H } px; min-height: ${ window . innerHeight * this . OPTIONS . H / 2 } px;"></div>
396
+ </div></div></div>` ;
397
+ document . body . insertAdjacentHTML ( 'beforeEnd' , html ) ;
405
398
/*X*/
406
399
let X = document . createElement ( 'i' ) ;
407
400
X . setAttribute ( 'class' , 'fa fa-close' ) ;
408
401
X . setAttribute ( 'style' , 'cursor: pointer' ) ;
409
402
X . addEventListener ( 'click' , function ( ) {
410
- document . body . removeChild ( modal ) ;
403
+ if ( document . getElementById ( 'dlp' ) instanceof HTMLElement ) {
404
+ document . getElementById ( 'dlp' ) . remove ( ) ;
405
+ }
411
406
if ( document . getElementById ( 'kvFileinputModal' ) instanceof HTMLElement ) {
412
407
document . getElementById ( 'kvFileinputModal' ) . remove ( ) ;
413
408
}
414
409
} , false ) ;
415
- let modal_body = document . createElement ( 'div' ) ;
416
- modal_body . className = "modal-body" ;
417
- modal_body . style = 'background-color:#f4f4f4;padding:0;overflow-y:auto;max-height:' +
418
- window . innerHeight * this . OPTIONS . H + 'px;min-height:' + window . innerHeight * this . OPTIONS . H / 2 + 'px;' ;
419
-
420
- this . MODEL_BODY_DOM = modal_body ;
421
- /*create modal*/
422
- modal_header . append ( X ) ;
423
- modal_content . append ( modal_header ) ;
424
- modal_content . append ( modal_body ) ;
425
- mod_dialog . append ( modal_content ) ;
426
- modal . appendChild ( mod_dialog ) ;
427
- document . body . append ( modal ) ;
410
+ document . getElementsByClassName ( 'modal-header' ) [ 0 ] . append ( X ) ;
411
+ this . MODEL_BODY_DOM = document . getElementsByClassName ( 'modal-body' ) [ 0 ] ;
428
412
}
429
413
430
414
makeContent ( ) {
0 commit comments