-
- 12 Posts
Very interesting.
It worked for exactly ONE button click with a clean install and minimal template selected (no other js).
So, I went back to my original site and noticed that it worked exactly ONE time after I changed the template (regardless of the template that I changed it to). All subsequent loads of the page ignore the button presses. However...
Now for the weird part. The only difference from when it works to when it doesn’t work is the inclusion of a second ieButtonFix.js include...?
<script type="text/javascript" src="assets/snippets/webloginpe/js/ieButtonFix.js"></script>
<script type="text/javascript" src="assets/snippets/webloginpe/js/ieButtonFix.js"></script>
I just reset the template so if you are the only one that tries it out, you can see that the first time the page loads, only one call and any ONE button works. The second time the page loads, second js script call, nothing works.
PM me if you want admin access, this is just a "stunt" site I was using for prototyping functionality for a client.
-Derrick
-
- 1,193 Posts
One of the users, Soshite, was having the same problem. I had him comment out the line in the snippet (I think it is around 94) where regClientStartupScript loads ieButtonFix.js and then just manually call the script in the head of his template and that fixed the problem.
I don’t know right now why WebLoginPE is loading it twice, but I have a team in the crime lab, working in shifts to figure this out. Just kidding, but I am looking into it.
-sD-
Dr. Scotty Delicious, DFPA.
-
- 12 Posts
No problem. That took care of it.
Let me know how the forensics team does on their late-night work....
Sounds like a Guinness night!
-Derrick
-
- 1,193 Posts
Thanks Jason.
I was looking over my code thinking... "I don’t know WTF I did wrong and there is a ton of letters and numbers here to look over!"
-sD-
Dr. Scotty Delicious, DFPA
-
- 1 Posts
I ran into the same problem. I found a work around that will allow it to work and still allow caching.
In the webloginpe snippet code, change the API call:
$modx->regClientStartupScript( ’assets/snippets/webloginpe/js/ieButtonFix.js’);
to
$modx->regClientScript( ’assets/snippets/webloginpe/js/ieButtonFix.js’);
This will cause it to be added to the bottom of the document body and not be included in the header.
It doesn’t seem to be included twice and all the functionality seems to work.
-
- 1,193 Posts
Good point shad0bear.
Unlike some of the scripts that can be registered with WebLoginPE, the ieButtonFix.js script does not need to be loaded in the head before the document is ready since the code in it is only executed when a button is pressed.
Thanks for sharing your success tip. I will probably put it into the next version of WebLoginPE using $modx->regClientScript() since it it technically more appropriate anyway.
-sD-
Dr. Scotty Delicious, DFPA.