diff options
author | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-06-29 01:00:15 +0200 |
---|---|---|
committer | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-06-29 01:00:15 +0200 |
commit | 5ddb312a752f9f468aec59a6b269305f1ff45822 (patch) | |
tree | 0c635111db6315a32f6eec42f3298e9e4c65f811 | |
parent | 49f3654d60267a8d66850297f843022706d76ba2 (diff) | |
download | electron-5ddb312a752f9f468aec59a6b269305f1ff45822.tar.gz electron-5ddb312a752f9f468aec59a6b269305f1ff45822.tar.bz2 electron-5ddb312a752f9f468aec59a6b269305f1ff45822.tar.xz electron-5ddb312a752f9f468aec59a6b269305f1ff45822.zip |
online box appears and disapears again -> still dummy data
-rw-r--r-- | src/renderer/gameserver/server.ts | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/renderer/gameserver/server.ts b/src/renderer/gameserver/server.ts index 235b8be..ed462c4 100644 --- a/src/renderer/gameserver/server.ts +++ b/src/renderer/gameserver/server.ts @@ -25,7 +25,7 @@ export default class GameServer { //Online counter const OnlineCounterContainer = document.createElement('div'); - OnlineCounterContainer.appendChild(makeOnlineCounterList(this)); + //OnlineCounterContainer.appendChild(makeOnlineCounterList(this)); sidebarItem.appendChild(OnlineCounterContainer); //Title const title = document.createElement('div'); @@ -38,7 +38,6 @@ export default class GameServer { titleText.innerText = this.menuName; - title.appendChild(titleIMG); title.appendChild(titleText); @@ -47,6 +46,41 @@ export default class GameServer { switchPage("SERVER",this.name); }); + let onlineBoxActive:boolean = false; + let onlineBoxSchouldBeActive:boolean = false; + let updateOnlineContainer = () => { + if(onlineBoxSchouldBeActive == onlineBoxActive)return; + while (OnlineCounterContainer.firstChild) { + OnlineCounterContainer.removeChild(OnlineCounterContainer.firstChild); + } + if(onlineBoxSchouldBeActive){ + OnlineCounterContainer.appendChild(makeOnlineCounterList(this)); + } + onlineBoxActive = onlineBoxSchouldBeActive; + console.log(onlineBoxSchouldBeActive); + } + + let SetUpdate = (state:boolean)=>{ + onlineBoxSchouldBeActive = state; + setTimeout(()=>{updateOnlineContainer();},160); + }; + + title.addEventListener("mouseover", ()=>{ + SetUpdate(true); + }); + + title.addEventListener("mouseout", ()=>{ + SetUpdate(false); + }); + + OnlineCounterContainer.addEventListener("mouseover", ()=>{ + SetUpdate(true); + }); + + OnlineCounterContainer.addEventListener("mouseout", ()=>{ + SetUpdate(false); + }); + sidebarItem.appendChild(title); //Collapsable |