From 37703120cae339abb70d49d4b08414a8f04ccbc5 Mon Sep 17 00:00:00 2001 From: artem-tim Date: Thu, 21 Feb 2019 19:51:37 +0900 Subject: [PATCH] Added anchor to custom event context --- README.md | 1 + jquery.modal.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e999680..e18800c 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/jquery.modal.js b/jquery.modal.js index 02c522d..73fde2d 100644 --- a/jquery.modal.js +++ b/jquery.modal.js @@ -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 }; } };