Skip to content

Commit

Permalink
Added anchor to custom event context
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-tim committed Feb 21, 2019
1 parent a229f49 commit 3770312
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ The first and only argument passed to these event handlers is the `modal` object
modal.$elm; // Original jQuery object upon which modal() was invoked.
modal.options; // Options passed to the modal.
modal.$blocker; // The overlay element.
modal.$anchor; // The anchor originating the event.
```

So, you could do something like this:
Expand Down
2 changes: 1 addition & 1 deletion jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

//Return context for custom events
_ctx: function() {
return { elm: this.$elm, $elm: this.$elm, $blocker: this.$blocker, options: this.options };
return { elm: this.$elm, $elm: this.$elm, $blocker: this.$blocker, options: this.options, $anchor: this.anchor };
}
};

Expand Down

0 comments on commit 3770312

Please sign in to comment.