OK, after some more investigation, I think I have narrowed my
question's focus.
When you create a MochiKit.DragAndDrop.Draggable object, the d&d code
uses MochiKit.Signal.connect() to connect an 'onmousedown' event to the
DOM element that you just made Draggable.
When you actually click on the Draggable DOM element, the code will
execute the function initDrag() which takes 1 parameter, "event".
As I now understand it, MochiKit.Signal uses a custom event object for
events, so I can't use the various browser-specific methods to
synthesize the onmousedown event to pass to initDrag or fire the
onmousedown event on the DOM element itself.
It appears that MochiKit.Signal contains all the required functionality
to create arbitrary event objects to pass to custom functions or
MochiKit.Signal.signal().
Let's say you have the following HTML:
<body>
<input type="button" id="button" value="click">
<script>
MochiKit.Signal.connect("button","onclick",function (e) {
MochiKit.Logging.log(e); });
MochiKit.Signal.signal("button","onclick");
</script>
</body>
When the page loads, you'll automatically get an error that reads
"this._event has no properties", because you're signaling "button" with
"onclick" but the event that is passed to the anonymous function isn't
using the custom event object.
If you manually click the button yourself, there won't be an error and
you'll get a log entry of the custom event object passed to the
anonymous function.
Assuming you MochiKit.Signal.connect() an event to an element, how do
you then programmatically create the custom event object, set its
parameters and then use it to signal the DOM element via
MochiKit.Signal.signal() to fire the event and pass the custom event
object to the connect()'d function?
Thanks in advance!
-Kevin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---