In our new Help system, we added onContextMenu="return false;" to the body tag, hoping to disable right-clicking. This works, however I noticed an issue. Not sure if this can be fixed, but hoping someone with more Javascript knowledge might be able to chime in.
Right-clicking on the area of the window where I have HTML is disabled. However, there appears to be a small (3-4 pixel) border at the top, left and right of the window where you can click and access a menu. Additionally, on short topics that do not fill the screen, everything below the last line of the text is right-clickable.
Anyone have a better idea that "return false"?
No Right-Click Menu, except...
No Right-Click Menu, except...
You do not have the required permissions to view the files attached to this post.
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: No Right-Click Menu, except...
Sounds as if the CHM Viewer places a layer on top of the background. That layer shows the rendered text and images. So when the layer does not cover the entire background the <body> isn't either and yet the viewer has to display something there. That may explain also the little bit of margin left at the sides.
Unless a CHM guru corrects me I tend to think that you are out of luck here.
But why do you want to disable the right-click menu in the first place?
Unless a CHM guru corrects me I tend to think that you are out of luck here.
But why do you want to disable the right-click menu in the first place?
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: No Right-Click Menu, except...
Do you have margins specified in your topics (e.g., margin:4px;)? I wonder if you set margins to 0 but add padding instead (to keep the text way from the frame borders) will work.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: No Right-Click Menu, except...
Basically, we use HTML comments for internal purposes (about what needs to be edited, etc). We are converting over to using Flare's Conditional Text for this, but there is a lot of legacy still in place. Plus, there is just a lot of junk in there, so not having View Source is the ideal.RamonS wrote:But why do you want to disable the right-click menu in the first place?
(Actually, I havnt disabled it, I have replaced it with a custom graphical right-click menu with the options we want to include, but that isnt really the point)
I havn't specified any margins myself, but it may be that there is a default margin. I could try setting the body to a negative margin and a positive padding to compensate. I'll look into it, but unfortunately that doesn't fix the bottom. Something to think on anyway.
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: No Right-Click Menu, except...
The bottom issue would go away if you stuff the topics with white space, speak a bunch of empty paragraphs. Rather ugly though.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: No Right-Click Menu, except...
I found a way to eliminate the issue on short topics. In the CSS, I needed to add a style for HTML and for Body that set height: 100%. Then it renders that across the entire area.
I also found that Flare had defaulted the Body to 10px margins, even though I had not specified them. I changed it to 0 margin and 8px padding, and this seems to have solved the issues.
Thanks guys!
I also found that Flare had defaulted the Body to 10px margins, even though I had not specified them. I changed it to 0 margin and 8px padding, and this seems to have solved the issues.
Thanks guys!