Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Obj-C to trigger JavaScript events containing additional key-value data #97

Merged
merged 1 commit into from
Mar 30, 2014

Conversation

jeff-h
Copy link
Member

@jeff-h jeff-h commented Mar 26, 2014

This adds the ability for the MacGap triggerEvent method to trigger an event on the JavaScript side, which contains a data object.

This is useful in numerous cases, and extends the triggerEvent method in a small but useful way.

For example, if the NSWorkspace detects a NSWorkspaceDidActivateApplicationNotification, it's helpful to pass information about the activated application back to the JavaScript event handler.

Javascript:

document.addEventListener('didActivateApplication', function(e){
    console.log(e.data);
}, true);

@jeff-h jeff-h merged commit cfe3dba into MacGapProject:master Mar 30, 2014
@jeff-h jeff-h deleted the event-trigger-dictionary branch April 20, 2014 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant