In my games inventory screen, it lists everything the player has picked up (including a thoroughly useless plunger). One section of the inventory has Lore items. I wanted to have their content come up in popup windows over the inventory, since moving to a passage and using the return would skip out of inventory entirely.
Unfortunately, the popup windows just stretch off the screen if the content goes too long. I tried limiting the size of the popups in their CSS section, and adding Overflow-y: Auto, but so far, neither of those have had any effect. Is there something I can add to make this work, or am I going to be looking at sneaky, underhanded workarounds? =^^=
CSS:
#ui-body.popup {
background-color: #0c0c0c;
max-height: 80%;
overflow-y: auto;
}
Javascript:
Macro.add("popup", {
version : { major: 1, minor: 0, revision: 0 },
handler : function () {
if (this.args.length < 2) {
var errors = [];
if (this.args.length < 1) { errors.push("link text"); }
if (this.args.length < 2) { errors.push("passage name"); }
return this.error("no " + errors.join(" or ") + " specified");
}
var el = document.createElement("a"),
passage = this.args[1],
title;
el.innerHTML = this.args[0];
el.className = "link-internal macro-popup";
el.setAttribute("data-passage", passage);
title = el.textContent;
UI.addClickHandler(el, null, function (evt) {
var dialog = UI.setup(title, "popup");
new Wikifier(dialog, tale.get(passage).processText().trim());
});
this.output.appendChild(el);
}
});
...I feel I should point out that while I am slowly learning, Javascript is still brickwalling me harder than the Capra demon.
EDIT: At GreyElf's suggestion, the Twinecode that's calling this up...
<<if $invsdchip>>\
<<popup "SSD Chip" "inv sdchip">>
<</if>>\
It isn't much, and "inv sdchip" is just straight text at the moment. There's just so much text that it goes off the bottom of the screen.