Skip to content

Commit

Permalink
Events onShow() and onHide() now have access to triggered element, too
Browse files Browse the repository at this point in the history
sandywalker#238

Mick Lawitzke on Jun 30, 2017
  • Loading branch information
q2apro committed Aug 15, 2019
1 parent 53e9685 commit b232ea6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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
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

0 comments on commit b232ea6

Please sign in to comment.