Feature request - get scroll events in general page iframe when parent window is scrolled

171 views
Skip to first unread message

Raimonds Simanovskis

unread,
Mar 7, 2015, 6:03:55 AM3/7/15
to atlassian-...@googlegroups.com
Hi

When eazyBI is used as full page application then we listen to window scroll events:
- to implement endless scrolling for large results tables (when you scroll to the end of the page then the next portion of table rows is loaded)
- to implement sticky headers for large tables (when you scroll down and table header is not visible then using fixed positioning it is shown in the top of the window)

When eazyBI add-on is used in JIRA Cloud as a general page then window scroll events are not visible in an iframe window (which is always auto-resized based on its content) and we also cannot detect what is or is not visible on the actual browser window.

It would be good if there would be an option that parent window scroll events would be passed to general page iframe (probably using existing events mechanism https://developer.atlassian.com/static/connect/docs/javascript/module-Events.html).
In this event as an argument we would need to get iframe "scrollTop" position. In full page application we use jQuery $(window).scrollTop() for that. In this event iframe "scrollTop" position probably should be passed as $(window).scrollTop() - $("iframe").offset().top
Then we could use this iframe "scrollTop" to calculate position for sticky table headers when needed.

In addition it would be good to have a possibility to check at any time if window scrollbar is visible or not (we enable that table sticky headers can be switched on/off only when scrollbar is visible).
Currently we were checking this with $("body").height() > $(window).height() but now in iframe with auto resizing they are always equal. So we would need to be able to check it from the parent window.

Any comments or questions about this feature request? Any other add-on developer would be interested in this?

Kind regards,
Raimonds

Chris Whittington

unread,
Mar 9, 2015, 11:54:47 AM3/9/15
to atlassian-...@googlegroups.com
Hi Raimonds,

If you're using a page module i've suggested the following to other vendors for these same issues.

Set sizeToParent:true in your add-on as follows:
<script src="path/to/all.js" data-options="sizeToParent:true;resize:false"></script>

Since the page no longer contains scroll bars, your add-on should now be able to listen to the scroll events inside your frame.

If you need a table with a fixed header, you can use CSS position fixed to keep the header in the same position as the other table cells scroll.
I have made an example html page that will function as a connect add-on here: https://bitbucket.org/cjwhittington/fixed-table-header/src


The problem with sending scroll events over the bridge is that they would need to be heavily throttled to stop bad performance. By doing this it would give very bad results for most use cases. eg: if you only got the scroll position every 100ms, your page would jump around. http://www.html5rocks.com/en/tutorials/speed/scrolling/ has an explanation of why these events would need to be throttled.

Regards,
Chris.

Raimonds Simanovskis

unread,
Mar 9, 2015, 4:07:43 PM3/9/15
to atlassian-...@googlegroups.com
Hi Chris

Thank you for the suggestions and for the sample code. And I understand that passing all scroll events to iframe might be problematic.

But there are several issues why the current sizeToParent solution does not quite suite our needs:

- In this case both standard JIRA header and footer is visible on the screen and just our content between them is scrollable.
JIRA footer takes significant space (more than 100 pixels) and we would like to use all window space to show our content. It would be good if AP.sizeToParent() function had a parameter where we could specify that we want to resize the iframe to the full height of the window (taking also the space of standard JIRA footer). And even better if we could specify the desired height of the iframe - if it is less than window height then it would be used or otherwise iframe would be resized to the window height and then iframe would show a scrollbar.
In addition it would be good if we could hide the standard JIRA header - e.g. when iframe content is scrolled down then we could hide the JIRA standard header (and resize iframe to take full height) and when the iframe is scrolled back to the top then we could show JIRA header again.

- The other problem is that when using sizeToParent then the iframe is not resized when the window is resized.
If window width is changed then iframe width is changed as well and resize event is triggered in iframe - we could use it to manually trigger AP.sizeToParent().
But if just window height is changed then resize is not happening in the iframe.
It would be good to get all window resize events also inside iframe to be able to initiate AP.sizeToParent() manually.

If we could have more control over JIRA header and footer visibility and be able to get all window resize events then probably we could use this modified sizeToParent solution.

Any comments on these suggestions?

Kind regards,
Raimonds

Chris Whittington

unread,
Mar 9, 2015, 7:03:20 PM3/9/15
to atlassian-...@googlegroups.com
Unfortunately the only way to take up the entire screen is to use a dialog. All page modules will include the product's header / footer - this was done deliberately and i'm unaware of any plans to change it.

I had a look at the code for SizeToParent and it looks like there's a bug for shrinking the window size. I have opened a ticket here: https://ecosystem.atlassian.net/browse/AC-1530

Regards,
Chris.

Roberto Dominguez

unread,
Mar 9, 2015, 7:45:27 PM3/9/15
to atlassian-...@googlegroups.com
Chris,

Thanks for all this information. We have had similar problems as Raimonds, and has taken us months to come up with a workable solution, but we are stuck with the same limitations.

There is nothing wrong with the footer, the problem is that it’s fixed and it’s a waste of real estate, I’d submitted https://ecosystem.atlassian.net/browse/ACJIRA-220 a while back.

Thing is, the behaviour is inconsistent: with project-tab modules, you don’t get that silly behaviour, but it is consistent with the rest of the tabs, and the look of the add-on is more natural, have a look: http://screencast.com/t/zHRBZFH5J

Again, there is nothing wrong with the footer, but with the behaviour of the footer, make it behave like it does with project tabs, but please, not the other way around ;-)

Roberto


--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raimonds Simanovskis

unread,
Mar 10, 2015, 4:44:43 AM3/10/15
to atlassian-...@googlegroups.com, coma...@comalatech.com
Hi

I thought of an alternative solution. It would be good if
- sizeToParent had an option to hide JIRA footer and our iframe would be resized to the bottom of the window
- and there would be some function which we could you to render JIRA footer HTML content and we could append it at the end of our iframe.
As this footer content seems to be static then I assume this shouldn't be a problem to always return the same footer content.
Probably this could be added also as an option to AP.sizeToParent() function to append JIRA footer at the end of our iframe.

As a result the scrolling behavior would be similar to other JIRA pages - if the content is large then the footer will be seen just when you scroll to the end of the iframe.

In addition the window resizing issue should be solved as well as I described earlier - every time when the main window is resized then sizeToParent for iframe should be done as well.

Kind regards,
Raimonds
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.

Roberto Dominguez

unread,
Mar 10, 2015, 5:37:20 AM3/10/15
to Raimonds Simanovskis, atlassian-...@googlegroups.com
Raimonds, Chris,

It was almost 1:00 am when I wrote that message ;) So yeah, the footer is shown because that was the only way we could get the floating headers to work… so, now we’ve got more real estate in the project view, but no floating headers, and floating headers in general page but limited real estate :’(

This has been a issue we’ve been dealing with for over a year, and we had to compromise in our solution… Now Rainmonds is making similar requests, I feel vindicated ;)

Roberto

Alan Parkinson

unread,
Mar 10, 2015, 5:40:25 AM3/10/15
to atlassian-...@googlegroups.com, Raimonds Simanovskis
+1

I wouldn't mind having a solution to this problem, the extra real estate would be handy

--
Alan Parkinson

CEO and co-founder, Hindsight Software Ltd

Hindsight Software Ltd is a company registered in England and Wales. Registered number: 08051221. Registered office: 12-14 Bridge Street, Leatherhead, Surrey, United Kingdom, KT22 8BZ 

To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages