Skip to content

Commit

Permalink
Added documentation for manually triggers configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
vermilion1 authored and samccone committed Oct 18, 2013
1 parent a790fb3 commit 3e38127
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/marionette.view.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,19 @@ view.$(".do-something").trigger("click");

The result of this is an alert box that says, "I DID IT!"

By default all triggers are stopped with `preventDefault` and `stopPropagation` methods. But you can manually configure the triggers using hash instead of event name. Example below triggers an event and prevents default browser behaviour using `preventDefault` method.
```js
Backbone.Marionette.CompositeView.extend({
triggers: {
"click .do-something": {
event: "something:do:it",
preventDefault: true,
stopPropagation: false // this param is optional and will default to false
}
}
});
```

You can also specify the `triggers` as a function that
returns a hash of trigger configurations

Expand Down

0 comments on commit 3e38127

Please sign in to comment.