This is a migrated thread and some comments may be shown as answers.

Application menu not hiding when clicking on an iframe

3 Answers 256 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 15 Oct 2014, 09:22 AM
Hi,

The site I am designing is has a RadRibbonBar across the top of the screen, with the bottom 80% of the screen taken up with an iframe that displays content based on ribbon bar interactions.  Unfortunately, I have found that the application menu will not hide if you click on the iframe, it will only hide if you click on the ribbon bar or on part of the parent frame.

I imagine the solution to this is to add javascript to the iframe click event (if such a thing exists) and to programatically hide the application menu, however, I cannot see any client side functions to achieve this and before I start randomly hiding elements manually I thought I should ask if there is a standard way to do this.

Also, I would be interested to know if anyone else has encountered this issue and if they have any better solutions.

Thank you

3 Answers, 1 is accepted

Sort by
0
Martin
Top achievements
Rank 1
answered on 15 Oct 2014, 09:24 AM
I apologise, I have posted this in the wrong forum and cannot see any way to delete the post.  If it could be moved to http://www.telerik.com/forums/aspnet-ajax/ribbonbar it would be appreciated.
0
Boyan Dimitrov
Telerik team
answered on 20 Oct 2014, 08:45 AM
Hello,

First I would suggest subscribing for the body element (within the iframe) on click event  and hide the application context menu of the RadRibbonBar of the parent document. Indeed It is a bit tricky to access an object in the parent page from the iframe context. Thus I am attaching a sample that implements very similar scenario.


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Martin
Top achievements
Rank 1
answered on 20 Oct 2014, 09:45 AM
Thanks for the response.

Ultimately I ended up using a jquery plugin called iframe tracker: https://github.com/finalclap/iframeTracker-jquery

It uses blur and mousemove events to provide click events on iframes.  Seems to do the trick. 

Unfortunately with my scenario it some of the iframe contents were cross domain which would prevent the click event from propagating.
Tags
RibbonBar
Asked by
Martin
Top achievements
Rank 1
Answers by
Martin
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or