From 00e4569280d247061be928d42e131f06def51876 Mon Sep 17 00:00:00 2001 From: Urthur Date: Tue, 12 Sep 2017 19:49:05 +0800 Subject: [PATCH] update --- bi/base.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/bi/base.js b/bi/base.js index dcf07f9dd..e7cb34fd4 100644 --- a/bi/base.js +++ b/bi/base.js @@ -3024,6 +3024,9 @@ BI.Combo = BI.inherit(BI.Widget, { var debounce = BI.debounce(function (e) { if (self.combo.element.__isMouseInBounds__(e)) { if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { + if (!o.toggle && self.isViewVisible()) { + return; + } o.toggle ? self._toggle() : self._popupView(); if (self.isViewVisible()) { self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); @@ -3040,6 +3043,33 @@ BI.Combo = BI.inherit(BI.Widget, { st(e); }); break; + case "click-hover": + var debounce = BI.debounce(function (e) { + if (self.combo.element.__isMouseInBounds__(e)) { + if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { + if (self.isViewVisible()) { + return; + } + self._popupView(); + if (self.isViewVisible()) { + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Combo.EVENT_EXPAND); + } + } + } + }, BI.EVENT_RESPONSE_TIME, true); + self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), function (e) { + debounce(e); + st(e); + }); + self.element.on("mouseleave." + self.getName(), function (e) { + if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) { + self._hideView(); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo); + self.fireEvent(BI.Combo.EVENT_COLLAPSE); + } + }); + break; } }); },