Skip to content

Commit 39a5153

Browse files
author
hikki
committed
v3.7
1 parent ecd8a97 commit 39a5153

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

resources/assets/component.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
padding: 0;
161161
border-radius: 3px;
162162
background: #ededed;
163+
width: 100%;
163164
}
164165
.dlp-dot-menu>.menu-list .dot-search{height: 24px}
165166
.dlp-dot-menu>.menu-list>.list{width:100%;max-height: 150px;overflow-y: auto;padding: 0 0 2px 0;}

resources/assets/component.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,24 @@ window.ComponentLine = class {
11191119
let input = document.createElement('input');
11201120
input.className = 'dlp dlp-input dot-search';
11211121
input.setAttribute('placeholder','搜索');
1122+
input.addEventListener('input',()=>{
1123+
setTimeout(() => {
1124+
if(input.value === ''){
1125+
for(let node of list.childNodes){
1126+
node.style.display = 'flex';
1127+
}
1128+
return;
1129+
}
1130+
for(let node of list.childNodes){
1131+
let text = node.firstElementChild.innerText;
1132+
if(text.indexOf(input.value) !== -1 || input.value.indexOf(text) !== -1){
1133+
node.style.display = 'flex';
1134+
}else {
1135+
node.style.display = 'none';
1136+
}
1137+
}
1138+
}, 300);
1139+
});
11221140

11231141
let list = document.createElement('div');
11241142
list.className = 'list dlp-scroll';

0 commit comments

Comments
 (0)