Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 23, 2024
1 parent 71b92e6 commit 6cca6f2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Tray.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
function getRandomColor() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function getTrayFromId(Id) {
return document.querySelector(`[data-tray-id="${Id}"]`).__trayInstance;
}
Expand Down Expand Up @@ -554,7 +562,6 @@ formatCreatedTime() {
} else {
foldButton.style.display = 'inline-block';
foldButtonRight.style.display = 'inline-block';

if (this.isFolded) {
content.style.display = 'none';
foldButton.textContent = '▶';
Expand Down Expand Up @@ -847,6 +854,11 @@ formatCreatedTime() {
childTray.parent = this;
childTray.parentId = this.id;
this.element.querySelector('.tray-content').appendChild(childTray.element)
if (this.children.length==1){
const color = getRandomColor();
this.borderColor = color;
this.updateBorderColor()
}
}
onContextMenu(event) {
event.preventDefault();
Expand Down

0 comments on commit 6cca6f2

Please sign in to comment.