Bug - Fixed "New" stationary buttons prevent kol's right click menu from loading result

xKiv

Active member
Right-click menu properly appears after combat, but clicking any option does "nothing".
Javscript console says "b is undefined".
Relevant code from ircm.js:
Code:
function loadingDiv() {
	$(top.mainpane.document).find("#effdiv").remove();
	if(!window.dontscroll || (window.dontscroll && dontscroll==0)) {
	   	window.scroll(0,0);
	}
	var d = document.createElement('DIV');
	d.id = 'effdiv';
	d.innerHTML = '<center><table cellspacing="0" width="95%"><tr><td align="center" style="color: white; background-color: blue">Results:</td></tr><tr><td align="center" style="border: 1px solid blue;">Loading Results...</td></tr></table></center><br />';
	var b = top.mainpane.document.body;
	if ($('#content_').length > 0) {
		b = $('#content_ div:first')[0];
	}
	b.insertBefore(d, b.firstChild);
}

Note how KoL first removes the #effdiv element, after which there is no div left under #content_. But since all content is contained in #content_, $('#content_').length is greater than zero (it has at least one child element). So javascript errors out at calling a function on undefined and nothing happens.
(I have kol CAB disabled, so my pages don't even have #content_ until mafia touches them)

I *think* the easiest fix to this is to put another empty div after #effdiv in StationaryButtonDecorator (there are two places in .decorate() that insert #effdiv) - this div has to be visible, otherwise the response will be also invisible.
That's what I did and it works for me locally.
 

Veracity

Developer
Staff member
Ha ha. Yes, KoL's CAB inserts an empty div after the effdiv:

"<div style='overflow: auto;'>"

I don't like the "auto" since it truncates our speculation. But an "overflow: visible" would be OK. Or, as you suggest, simply "<div>".
 

Veracity

Developer
Staff member
Try revision 13255. I also fixed it to allow right-click to work on the table of "items found in this fight"
 
Top