Welcome, Guest. Please login or register.

Login with username, password and session length
July 29, 2010, 10:43:26 pm

 

   Home   Help Search Login Register  

Pages: [1]   Go Down
  Print  
Author Topic: Firefox 3 beta 5 and context menu [SOLVED]  (Read 5027 times)
nico.pao
New User
*
Offline Offline

Posts: 32


View Profile
« on: June 04, 2008, 10:45:45 am »

Hi everybody.
I'm using eyeOS with Firefox 3 beta 5 and Ubuntu Hardy.
The problem is the following:
When I right-click the desktop, the firefox context-menu appears over eyeos context-menu.
Is there a way to fix this problem???
« Last Edit: June 07, 2008, 06:32:22 pm by nico.pao » Logged
Daniel Gil
eyeOS Team
Full User
*****
Offline Offline

Posts: 174


View Profile WWW
« Reply #1 on: June 04, 2008, 11:54:44 am »

Yes there is. I don't remember exactly how the preferences menu's disposition is in FF3, but at least for FF2 you can disable its context menu going to Preferences->Content tab->clicking Javascript "Advanced" button->Checking the "Disable or replace context menus" option.

My FF is not in english, so the text may be a bit different from the english version, but I don't think it varies too much.
Logged
psychcf
Full User
***
Offline Offline

Posts: 106


View Profile
« Reply #2 on: June 04, 2008, 12:38:14 pm »

I really do think that you should add e.preventDefault() to the code...
Code:
document.getElementById("myNode").oncontextmenu=function(e) {
e.preventDefault();
// ...
}

That will prevent the context menu from showing, even if that option is not checked.
Logged

nico.pao
New User
*
Offline Offline

Posts: 32


View Profile
« Reply #3 on: June 06, 2008, 07:42:04 am »

OK, I was looking for a js command to do it without modifying preferences, and the idea of psychcf seems fine, but how can I easily apply that code to all the HTML elements of eyeOS, making this change persistent during all the eyeOS session??

Thanks
Logged
Lars Knickrehm
eyeOS Team
Hero User
*****
Offline Offline

Posts: 2548


View Profile WWW
« Reply #4 on: June 06, 2008, 02:19:05 pm »

in the file extern/libs/BaseWidgets.js search for "oncontextmenu = function" and add this line after the line you searched for:

Code:
e.preventDefault();

Does that work?

I now tried that myself but it does not work Sad ...
« Last Edit: June 06, 2008, 02:27:02 pm by Lars Knickrehm » Logged

Regards,
Lars Knickrehm

The eyeOS project 2010. http://eyeos.org/
psychcf
Full User
***
Offline Offline

Posts: 106


View Profile
« Reply #5 on: June 06, 2008, 03:28:33 pm »

oh, I forgot you also have to prevent the event from propagating...

here's the full code:
Code:
function onSomething(evt) {
 var isIE = parseFloat(navigator.appVersion.split("MSIE ")[1]) || 0;
 if(isIE) {
  evt = evt || window.event;
  evt.cancelBubble = true;
  evt.returnValue = false;
 }
 else {
  evt.preventDefault();
  evt.stopPropagation();
 }
}

This is from a ticket that I reported, but it was marked as "won't fix"
https://bugs.launchpad.net/eyeos/+bug/219987
Logged

Lars Knickrehm
eyeOS Team
Hero User
*****
Offline Offline

Posts: 2548


View Profile WWW
« Reply #6 on: June 06, 2008, 04:16:12 pm »

Thanks, that works fine Smiley !

Here is the correct code for eyeOS:

Serach for

Code:
obj.oncontextmenu = function(e) {

in the file "eyeOSxxxxxxxxxx/extern/libs/eyeWidgets/BaseWidgets.js" and replace that line with these:

Code:
obj.oncontextmenu = function(e) {
if (IEversion > 0) {
e.cancelBubble = true;
e.returnValue = false;
} else {
e.preventDefault();
e.stopPropagation();
}
Logged

Regards,
Lars Knickrehm

The eyeOS project 2010. http://eyeos.org/
nico.pao
New User
*
Offline Offline

Posts: 32


View Profile
« Reply #7 on: June 07, 2008, 07:54:24 am »

IT WORKS!!!!!!!!

Are you sure that the code added is compatible with other browsers???
If it is, such change should be made avaiable for download as a bugfix for all the user. Don't you agree???

Thanks
Logged
psychcf
Full User
***
Offline Offline

Posts: 106


View Profile
« Reply #8 on: June 07, 2008, 03:21:53 pm »

Are you sure that the code added is compatible with other browsers???

Yes, that is 100% cross browser.
Logged

nico.pao
New User
*
Offline Offline

Posts: 32


View Profile
« Reply #9 on: June 07, 2008, 06:31:41 pm »

well, I hope to see this update as soon as possible!!!

Thanks everyboduy
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!