Odd popup behavior in HATS

Here is an issue that has cropped up on the 7.x release of HATS. Its very very minor one, but can eat up a bunch of hours to troubleshoot.

Lets say you have a popup selection widget, and specify you want it to display with the image rather than a button or link.

Let’s also say that your HATS widget is placed within an absolute positioned element (i.e. style=”position: absolute” or within a style selector of your CSS file).

You will have two issues. One, the popup will be positioned relative to the absolutely positioned element that contains it. You can get around that by forcing the popup DIV to be a child of the BODY element in the popup(popupid) function:

document.body.appendChild(content);

Next, there will be an issue in IE where if a user clicks the popup, closes it and re-opens the popup, the popup will migrate upwards or away from where it first opened. This is only an IE issue and it applies to version 6,7,and 8. You’ll need to add the following to the getButton(popupid) method – just above the final return statement:

// The following is to account for a popup that is triggered by an image.var imgs = document.getElementsByTagName("IMG");for (i=0;ivar element = imgs[i];var onclickstring=" "+element.onclick;if (onclickstring.indexOf(popupid)!=-1 ) {// now that we have found the elementreturn element;}}

About Us

We are an information technology consulting firm specializing in the areas of Enterprise Modernization, DevOps, and process improvement. We are experts at iterative (agile) software development frameworks such as Scrum and SAFe, and in enterprise architectures such as Spring, Java EE, and other such frameworks. We have successfully helped IT organizations reduce their total cost of operations by refactoring their enterprise IT architecture, updating legacy applications, and moving to more scalable architectural patterns of development.