-
Re: Tile - scroll top-level window from inside iFrame?
Ryan Rutan Jan 25, 2016 1:07 PM (in response to butch)I am not familiar with an OpenSocial spec that does this ... and in general I haven't heard of this in any conversations. Could you share some of the use-cases, and I'll try to document the request for consideration?
-
Re: Tile - scroll top-level window from inside iFrame?
butch Jan 26, 2016 4:23 AM (in response to Ryan Rutan)Hey Ryan,
This video best demonstrates the user experience we want to guarantee. This is done using hackery right now though that cannot be guaranteed if tiles/canvas views are in different domains.
-
-
Re: Tile - scroll top-level window from inside iFrame?
Ryan Rutan Jan 29, 2016 12:36 PM (in response to butch)Yuval Twig Edward Venaglia - Any thoughts on this one? Specifically in an environment with high app security (different domains).
Basically a Tile.onFocus event that the Tile can call after adjustHeight()?
-
Re: Tile - scroll top-level window from inside iFrame?
butch Jan 30, 2016 12:24 PM (in response to Ryan Rutan)Hey Ryan - I'm envisioning a little bit different of an interface. Here is the code we're currently calling:
var header_height = 0;
var header_height = window.parent.jQuery("#j-header-wrap").outerHeight();
window.parent.jQuery("html, body").animate({
scrollTop: window.parent.jQuery(window.frameElement).offset().top - header_height
}, 500);
What would be useful is an interface for adjusting the scrollTop of the window.top element. Maybe:
gadgets.window.scrollTop() -> Get scrollTop
gadgets.window.scrollTop(50) -> Set scrollTop
or... even...
gadgets.window.scrollToFocus() -> Scroll viewport to the top of this tile?
-
Re: Tile - scroll top-level window from inside iFrame?
Scott A Johnson Feb 1, 2016 11:15 AM (in response to butch)3 people found this helpfulHey Butch Marshall, until that's built into the gadgets api, how about a different hack?
I was able to get effectively a "scroll to top" by calling adjustHeight with a small value, then calling it again with no value. Essentially forcing the scroll by making the iframe tiny which would scroll the page up to the top of the iframe. I also had to delay the second call since the adjustHeight doesn't have a callback parameter.
gadgets.window.adjustHeight(10); setTimeout(gadgets.window.adjustHeight, 200);
You should be able to roll your own scroll to top method by calling the gadgets.rpc.call function and passing adjustHeight as it's callback, but for some reason the callback didnt seem to be called for me, this is why i went for the extra hacky timeout call. 200ms seemed to be sufficient in my test, but YMMV, it may depend on the exisitng height of the pane as it resizes somewhat smoothly. With 100ms, it seemed to scroll about halfway up before the full resize stopped it.
-
Re: Tile - scroll top-level window from inside iFrame?
butch Apr 8, 2016 8:13 AM (in response to Scott A Johnson)Hi Scott A Johnson - this doesn't really produce the behaviour that we're hoping for.
It's more of a jump-close-to-top rather than a nice and smooth scroll up that we can get with the jQuery execution method?
Do you or Ryan Rutan have any suggestions that would allow me to produce the behaviour shown in my GIF?
Thanks!
Ping Steven Green, Brennan Kirby and Markus Nagel so you guys can find this thread better in the future!
-
Re: Tile - scroll top-level window from inside iFrame?
butch May 27, 2016 12:23 PM (in response to butch)Sorry just to add, with additional testing I've encountered that this only adjusts the pages height if:
1) the iFrame you want in focus is at the very bottom of the page.
or
2) the iFrame is the largest iFrame on the page.
-
Re: Tile - scroll top-level window from inside iFrame?
Brennan Kirby Aug 19, 2016 12:54 PM (in response to butch)JIRA # 67334
-
Re: Tile - scroll top-level window from inside iFrame?
jgoldhammer May 31, 2017 12:12 AM (in response to Brennan Kirby)Hi Brennan,
any news according the JIRA ticket 67334?
Thanks
Jens
-
Re: Tile - scroll top-level window from inside iFrame?
Ryan Rutan Jun 1, 2017 11:20 AM (in response to jgoldhammer)As part of an internal shift, the case is now CLOUD-2607. Unfortunately no update =\
-
-
-
-
-
Re: Tile - scroll top-level window from inside iFrame?
andrewfrueh Jan 27, 2017 6:26 PM (in response to Scott A Johnson)Thanks very much for suggesting this workaround Scott! It's not perfect, but it's definitely better than nothing. +1 to the Jive team on the request to add a more robust solution to the Javascript API - some kind of function that would allow us to scroll the parent window from the custom tile.
-
-
-
Re: Tile - scroll top-level window from inside iFrame?
jgoldhammer Jan 28, 2017 11:39 AM (in response to Ryan Rutan)1 person found this helpfulOne idea would be the postmessage function of browsers which allows cross origin communication.
I have already used that in the past for another platform which integrates addons via Iframes...
Window.postMessage() - Web APIs | MDN
Almost all browsers support it and if you validate the source of the caller it is a very safe approach...
Thanks
Jens
-
Re: Tile - scroll top-level window from inside iFrame?
jgoldhammer Jan 28, 2017 11:40 AM (in response to Ryan Rutan)-
Re: Tile - scroll top-level window from inside iFrame?
jgoldhammer Jun 27, 2017 4:12 AM (in response to jgoldhammer)-
Re: Tile - scroll top-level window from inside iFrame?
Ryan Rutan Jun 27, 2017 6:43 AM (in response to jgoldhammer)1 person found this helpfulUnfortunately, no. Will need to see what pans out from the Engineering Team re-orgs before there will be any insight as to priority, cadence, etc... for these items. Wish I had a better answer. =\
-
Re: Tile - scroll top-level window from inside iFrame?
Steven Green Jun 28, 2017 4:50 AM (in response to Ryan Rutan)1 person found this helpfulThis is a small fix that will improve the Jive experience for most of your clients today or in the coming months. I'll suggest the voice of the customer be added to this thread so it's not just a partner ask.
-
-
-
-