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

Events onShow() and onHide() now have access to triggered element, too #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ $('a').webuiPopover('destroy');
autoHide:false, // automatic hide the popover by a specified timeout, the value must be false,or a number(1000 = 1s).
offsetTop:0, // offset the top of the popover
offsetLeft:0, // offset the left of the popover
onShow: function($element) {}, // callback after show
onHide: function($element) {}, // callback after hide
onShow: function($element, $triggerElement) {}, // callback after show
onHide: function($element, $triggerElement) {}, // callback after hide
}
```

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.webui-popover.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* webui popover plugin - v1.2.17
* webui popover plugin - v1.2.18
* A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary!
* https://github.com/sandywalker/webui-popover
*
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.webui-popover.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* webui popover plugin - v1.2.17
* webui popover plugin - v1.2.18
* A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary!
* https://github.com/sandywalker/webui-popover
*
Expand Down Expand Up @@ -282,7 +282,7 @@
this.$element.trigger('hidden.' + pluginType, [this.$target]);

if (this.options.onHide) {
this.options.onHide(this.$target);
this.options.onHide(this.$target, this.getTriggerElement());
}

},
Expand Down Expand Up @@ -357,7 +357,7 @@
this.displayContent();

if (this.options.onShow) {
this.options.onShow($target);
this.options.onShow($target, this.getTriggerElement());
}

this.bindBodyEvents();
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.webui-popover.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/jquery.webui-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
this.$element.trigger('hidden.' + pluginType, [this.$target]);

if (this.options.onHide) {
this.options.onHide(this.$target);
this.options.onHide(this.$target, this.getTriggerElement());
}

},
Expand Down Expand Up @@ -349,7 +349,7 @@
this.displayContent();

if (this.options.onShow) {
this.options.onShow($target);
this.options.onShow($target, this.getTriggerElement());
}

this.bindBodyEvents();
Expand Down