From 568a930fdabb8dc469e64dfc966125bc3ca5f6fd Mon Sep 17 00:00:00 2001 From: superman Date: Tue, 18 Oct 2022 15:50:14 +0800 Subject: [PATCH] Merge pull request #200530 in DEC/fineui from master to feature/x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commit 'b3540cf33517b3b0231b692d0d1085a1d301eb3e': 无JIRA chore: 描述 KERNEL-13123 feat: combo trigger支持 hover-click --- src/base/combination/bubble.js | 11 ++++++++++- typescript/core/platform/web/detectElementResize.ts | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index d3bc2975a..1af43b79c 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -12,7 +12,7 @@ attributes: { tabIndex: -1, }, - trigger: "click", // click || hover || click-hover || "" + trigger: "click", // click || hover || click-hover || "hover-click" || "" toggle: true, direction: "", placement: "bottom-start", // top-start/top/top-end/bottom-start/bottom/bottom-end/left-start/left/left-end/right-start/right/right-end @@ -219,6 +219,15 @@ } }); break; + case "hover-click": + self.element.on("mouseenter." + self.getName(), function (e) { + if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { + self._popupView(e); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Bubble.EVENT_EXPAND); + } + }); + break; default: break; } diff --git a/typescript/core/platform/web/detectElementResize.ts b/typescript/core/platform/web/detectElementResize.ts index c0ba6e28d..8e1566ce9 100644 --- a/typescript/core/platform/web/detectElementResize.ts +++ b/typescript/core/platform/web/detectElementResize.ts @@ -2,5 +2,5 @@ import { Widget } from "../../../core/widget"; export type _DetectElementResize = { addResizeListener: (widget: Widget, fn: Function) => Function - removeResizeListener: (widget: Widget, fn: Function) => void -} \ No newline at end of file + removeResizeListener: (widget: Widget, fn?: Function) => void +}