mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 21:30:33 +02:00
Fix goto and expand displaying as hovered when redisplay mini tablet
This commit is contained in:
parent
5fcb69c724
commit
66f75e856e
2 changed files with 41 additions and 7 deletions
|
@ -64,6 +64,10 @@ img {
|
||||||
background-image: url("./img/mt-goto-hover.svg");
|
background-image: url("./img/mt-goto-hover.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#goto:hover.unhover {
|
||||||
|
background-image: url("./img/mt-goto-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
#expand {
|
#expand {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 1px;
|
right: 1px;
|
||||||
|
@ -78,6 +82,10 @@ img {
|
||||||
background-image: url("./img/mt-expand-hover.svg");
|
background-image: url("./img/mt-expand-hover.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#expand:hover.unhover {
|
||||||
|
background-image: url("./img/mt-expand-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
#expand img {
|
#expand img {
|
||||||
width:34px;
|
width:34px;
|
||||||
margin-top: 7px;
|
margin-top: 7px;
|
||||||
|
|
|
@ -26,7 +26,30 @@
|
||||||
muteImage,
|
muteImage,
|
||||||
gotoButton,
|
gotoButton,
|
||||||
gotoImage,
|
gotoImage,
|
||||||
expandButton;
|
expandButton,
|
||||||
|
|
||||||
|
// Work around buttons staying hovered when mini tablet is replaced by tablet proper then subsequently redisplayed.
|
||||||
|
isUnhover = true;
|
||||||
|
|
||||||
|
// #region Utilites ========================================================================================================
|
||||||
|
|
||||||
|
function setUnhover() {
|
||||||
|
if (!isUnhover) {
|
||||||
|
gotoButton.classList.add("unhover");
|
||||||
|
expandButton.classList.add("unhover");
|
||||||
|
isUnhover = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearUnhover() {
|
||||||
|
if (isUnhover) {
|
||||||
|
gotoButton.classList.remove("unhover");
|
||||||
|
expandButton.classList.remove("unhover");
|
||||||
|
isUnhover = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
// #region Communications ==================================================================================================
|
// #region Communications ==================================================================================================
|
||||||
|
|
||||||
|
@ -50,25 +73,28 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onButtonHover() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: HOVER_MESSAGE
|
||||||
|
}));
|
||||||
|
clearUnhover();
|
||||||
|
}
|
||||||
|
|
||||||
function onMuteButtonClick() {
|
function onMuteButtonClick() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: MUTE_MESSAGE
|
type: MUTE_MESSAGE
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onButtonHover() {
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
|
||||||
type: HOVER_MESSAGE
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
function onGotoButtonClick() {
|
function onGotoButtonClick() {
|
||||||
|
setUnhover();
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: GOTO_MESSAGE
|
type: GOTO_MESSAGE
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onExpandButtonClick() {
|
function onExpandButtonClick() {
|
||||||
|
setUnhover();
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: EXPAND_MESSAGE
|
type: EXPAND_MESSAGE
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue