[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-03 Thread T.J. Crowder

Hi,

http://prototypejs.org/api/event/stop

It's worth taking an hour and reading through the API docs from
beginning to end.  It literally takes that long, and it saves you a
lot more time than that in the long run:
http://prototypejs.org/api

Hope this helps,
--
T.J. Crowder
tj / crowder software / com

On Oct 3, 7:20 am, Maikel Punie [EMAIL PROTECTED] wrote:
 hmm,

 it seems that i was not verry clear in the explenation

 if i use document.body.oncontextmenu = ContextShow;

 the browsers contextmenu is not showen because i return false in the
 ContextShow function.

 when i do the same with Event.observer( document.body, 'contextmenu',
 ContextShow);

 the browser window and my context menu are showen, so the return false in
 ContextShow does not seem to work ...

 Any ideas how to fix this?

 Maikel

 On Thu, Oct 2, 2008 at 8:51 PM, Justin Perkins [EMAIL PROTECTED]wrote:



  On Thu, Oct 2, 2008 at 12:47 PM, kangax [EMAIL PROTECTED] wrote:
   It could, if you are using an older version. Latest one doesn't check
   against a list of event names, so observing an event on document.body
   should work.

  Yes it does. I thought it was only a window event but sure enough it
  works fine on the body as well.

  -justin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-03 Thread Andrew Dupont

You want to call event.preventDefault() in your handler. This
prevents the default action (showing the context menu, in this case)
from happening.

Cheers,
Andrew

On Oct 3, 1:20 am, Maikel Punie [EMAIL PROTECTED] wrote:
 hmm,

 it seems that i was not verry clear in the explenation

 if i use document.body.oncontextmenu = ContextShow;

 the browsers contextmenu is not showen because i return false in the
 ContextShow function.

 when i do the same with Event.observer( document.body, 'contextmenu',
 ContextShow);

 the browser window and my context menu are showen, so the return false in
 ContextShow does not seem to work ...

 Any ideas how to fix this?

 Maikel

 On Thu, Oct 2, 2008 at 8:51 PM, Justin Perkins [EMAIL PROTECTED]wrote:



  On Thu, Oct 2, 2008 at 12:47 PM, kangax [EMAIL PROTECTED] wrote:
   It could, if you are using an older version. Latest one doesn't check
   against a list of event names, so observing an event on document.body
   should work.

  Yes it does. I thought it was only a window event but sure enough it
  works fine on the body as well.

  -justin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-02 Thread Justin Perkins

You need to attach it to the window object, not the document.body object.

Event.observe(window, 'contextmenu', someMethod);

-justin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-02 Thread kangax

On Oct 2, 10:25 am, Maikel Punie [EMAIL PROTECTED] wrote:
 hi,

 i'm trying to rework my js files to use prototype, everything is working
 like a charm except the following line i can't get it replaced with an
 event.

 document.body.oncontextmenu = ContextShow;

 i trying to replace it with something like

 Event.observe( document.body, 'contextmenu', ContextShow );

 could it be that there is no definition for the oncontextmenu handler in
 prototype?

It could, if you are using an older version. Latest one doesn't check
against a list of event names, so observing an event on document.body
should work.


 regards,
 Maikel

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: event.observer oncontextmenu

2008-10-02 Thread Justin Perkins

On Thu, Oct 2, 2008 at 12:47 PM, kangax [EMAIL PROTECTED] wrote:
 It could, if you are using an older version. Latest one doesn't check
 against a list of event names, so observing an event on document.body
 should work.

Yes it does. I thought it was only a window event but sure enough it
works fine on the body as well.

-justin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---