Tested it a moment ago and it does some strange things now;
1. Resize on click does not take place when ‘reply’ button is clicked. It does however resize when i click outside the activity stream (page margin) after clicking the reply button.
2. Clicking load more still resizes (jquery resize), but it gives system popup saying; the page on *url* reports; Ajax
3. On a related note; When i click inside the reply box (which opens after clicking the reply button), the page also resizes. This causes it to jump to the top of the framed page, making it very confusing as this lands the user on top of the main activity update box.
1. Seems that maybe the click event is added dynamically later on or the propagation of the event was stopped.
I have now used another way to attach the event.
which WordPress version do you use?
2. This was a debug line for me. I have removed this now.
3. This should be gone as well if you have wordpress > 3.0 because I now only add this at links.
http://www.tinywebgallery.com/dl.php?file=advanced-iframe
Ok, seems this took us a step back in the thread. The system popup (2) was solved, but resize on click does not function anymore. Using WP 3.5.
P.S. Resize at ‘load more’ also jumps to top of iframed page
I checked the code of the page you use.
the problem is that an onclick event handler is added.
I also one (I can see while debugging that it is there).
But the event from your script does return false – This means that no other action is done. And it has to be that way because otherwise the link itself gets executed. And this is not wanted.
I found out that a solution is not possible with jQuery because you cannot change the order of the events very nicely. Seems each jQuery version does store this info differently and a solution would only work for one version.
But the basic Javascript event handler have a way to attach to the event earlier.
I’m testing this version right now but it is a little bit more complicated because the event is fired for each click and I have to filter them first.
I’ll let you know when this is done…
So. I do now use the Javascript event handler that is before the jquery one. By default all links are intercepted. But you can now specify the id as well.
I also do now save the scroll position and set it again after the resize.
So please try again.
Ok, tested again. Results are good, if somewhat inconsistend (see 1);
1. On first page-load, clicking reply, followed by ‘load more’ seemed to disable the resize on load more. Refreshing the page strangely solved this, after the refresh both options worked in perfect harmony. edit: I ran into this issue twice, but have since been unable to reproduce it in further testing.
2. The ‘read more’ option no longer resizes the iframe height, most likely because the ‘is jquery’ option needs to be turned off for the ‘reply’ resize to work
3. Resizing no longer causes the page to jump to top π
Overall, this seems to be a huge step forward.
you need to turn is jquery on because your AJAX events are jquery.
Reply is done by jquery and the click uses a Javascript handler jquery does not use. So in my opinion they should not interfere.
Maybe the loading time of the page is an issue here. After clicking reply the page is loaded quicker which solves the timing issues.
What maye is an issue: the load more is also a link – so click does also work here. Go to the configuration and use a:acomment instead of a only. then only the reply links get the onclick event.
I have some debug alerts in the code you can enable if you like.
set $debug = true; in line 432 of advenced-iframe.php then you see when a click was intercepted and a Ajax call returns.
I just tested an the onclick does also work for the load more… So this only work now because the click does trigger the resize – but if the ajax request takes a little bit longer it does not work…
I tested with Firefox btw.
So I think it is important to use a:acomment
Best, Michael
You were right. I added a:acomment and enabled ‘is jquery’ and everything works fine now. I will be conducting some further tests with the other elements of buddypress (group forums, profile and such) after the weekend. As it stands now, you have done something I (and a lot of people who’s support threads i read) thought imposible; merging buddypress and wordpress pages.
I simply cannot thank you enough for your help on this issue. You sir, went above and beyond with your support.
Great. If you find any problems please let me know.
I will now release this as version 3.1.
It would be nice if you vote for it or write a small review..
Best, Michael
I voted a 5/5 and left an honest review. It was really the least I could do to thank you for all your help. I will let you know if run into any issues after further testing.
Thanks,
You did good testing and provided access to your platform as well.
So hopefully this version gets really successful.
3.1 is now online. Can you please mark that this version works?
Just did. Tested other buddypress components a little; so far everything works perfectly. If you are interested in tweaking the plugin even more, i may have another support question for you (white flash on load related). Seems there are some easy css solutions for this that you could implement. Just a thought.