Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/decorators/staticMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CONSTANT from "../constant";
const dispatchGlobalEvent = (eventName, opts) => {
// Compatible with IE
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
// @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
let event;

if (typeof window.CustomEvent === "function") {
Expand Down Expand Up @@ -52,10 +53,11 @@ export default function(target) {

target.prototype.globalShow = function(event) {
if (this.mount) {
const hasTarget =
(event && event.detail && event.detail.target && true) || false;
// Create a fake event, specific show will limit the type to `solid`
// only `float` type cares e.clientX e.clientY
const e = { currentTarget: event.detail.target };
this.showTooltip(e, true);
this.showTooltip({ currentTarget: hasTarget && event.detail.target }, true);
}
};

Expand Down