Skip to content

Commit 310da3a

Browse files
author
hikki
committed
v5.1
1 parent 6627e2b commit 310da3a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

resources/assets/component.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
flex-wrap: wrap;
178178
padding: 0;
179179
border-radius: 3px;
180-
background: #ededed;
180+
background: #ffffff;
181181
width: 100%;
182182
}
183183
.dlp-dot-menu>.menu-list .dot-search{height: 24px}
@@ -197,8 +197,8 @@
197197
justify-content: center;
198198
align-items: center;
199199
}
200-
.dlp-dot-menu>.menu-list .option:hover,.dlp-dot-menu>.menu-list .option-active{background: #dbdbdb}
201-
.dlp-dot-menu .search-box{width: 100%;height: 26px;padding: 2px}
200+
.dlp-dot-menu>.menu-list .option:hover,.dlp-dot-menu>.menu-list .option-active{background: #ededed}
201+
.dlp-dot-menu .search-box{height: 26px;padding: 2px}
202202
.dlp-dot-menu .search-box>input{
203203
border: 1px solid #bdbdbd;
204204
}

resources/assets/component.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ window.ComponentDot = class {
251251
this.DOM.addEventListener("contextmenu", (e) => {
252252
e.preventDefault();
253253
});
254-
this.menu = Object.assign({mode: false, placeholder: '未选择', height: '150px'}, menu);
254+
this.menu = Object.assign({mode: false, placeholder: '未选择', height: '150px',toward:true}, menu);
255255
selected = selected.filter(d=>{
256256
if(select[d] === undefined)return false;
257257
return true;
@@ -377,6 +377,15 @@ window.ComponentDot = class {
377377
});
378378

379379
this.DOM.append(menu);
380+
if(this.menu.toward === false){
381+
menu_list.style.display = 'flex';
382+
menu_list.style.top = `-${menu_list.clientHeight}px`;
383+
menu_list.style.height = `${menu_list.clientHeight}px`;
384+
menu_list.style.flexDirection = 'column-reverse';
385+
menu_list.style.display = 'none';
386+
}else {
387+
menu_list.style.flexDirection = 'column';
388+
}
380389
this.DOM.insertAdjacentHTML('beforeend', `<input name="${this.name}[select]" value='${JSON.stringify(selected)}' type="hidden"><input name="${this.name}[insert]" value="[]" type="hidden"><input name="${this.name}[delete]" value="[]" type="hidden">`);
381390
this.SELECTED_DOM = document.querySelector(`#${this.name} .dlp-dot-menu-select`).firstElementChild;
382391
this.CONTENT_DOM = document.querySelector(`#${this.name} .list`);

0 commit comments

Comments
 (0)