Replies: 1 comment
-
|
Also... On mobile, when a link is at the bottom of the screen, the object link dropdown will sometimes appear too low, with all or part of it below the visible text on screen. I changed the code in the links library to apply CSS to set the bottom of the menu options element at the link, so it will pop up above the link rather then drop down below it. I also added an event listener that closes any open object link menu when clicking outside of that menu's element. settings.nameTransformer = function (alias, obj, options = {}) {
if (!settings.linksEnabled) return alias;
if (options.noLink) return alias;
let s = `<span class="object-link dropdown" data-objname="${obj.name}"`;
//for (const key in options) s += ` data-${key}="${options[key]}"`
s += '><span onclick="itemLinks.itemClick(this, event)" ';
s += `obj="${obj.name}" class="droplink" name="${obj.name}-link">${alias}</span>`;
s += `<span obj="${obj.name}" class="dropdown-content">`;
s += `<span obj="${obj.name}-verbs-list-holder">`;
s += itemLinks.getVerbsLinks(obj);
s += "</span></span></span>";
return s;
}; document.addEventListener("click", function (e) {
// If click is not inside any .dropdown-content or a dropdown trigger
const isDropdown = e.target.closest(".dropdown-content");
const isTrigger = e.target.closest(".dropdown");
if (!isDropdown && !isTrigger) {
for (const el of document.querySelectorAll(".dropdown-content")) {
el.style.display = "none";
}
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Before I forget, also see #23
CSS is far my being something I am good at, so this can most assuredly use some tweaking...
Plus, all I have to test things with is an Android phone, and I know that iStuff behaves slightly differently quite frequently. =)
All that aside, I've been hacking away at the style settings and scrolling behavior, mostly focusing on mobile (although I actually see no difference on desktop after the scrolling tweaks).
If you'd like to viddy an example, the game can be played on GitHub Pages here: https://kvongit.github.io/Koww_QuestJS/play.html
The style setting stuff is the latest post in that issue (link at the beginning of this post), and here are the scrolling bits:
Comments and suggestions are always more than welcome and much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions