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/src/widget/multiselect/check/multiselect.display.js b/src/widget/multiselect/check/multiselect.display.js index 337afd59f..b5b4f76e8 100644 --- a/src/widget/multiselect/check/multiselect.display.js +++ b/src/widget/multiselect/check/multiselect.display.js @@ -26,6 +26,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { var self = this, opts = this.options; this.hasNext = false; + var cacheItems = []; this.button_group = BI.createWidget({ type: "bi.list_pane", @@ -45,10 +46,29 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { }] }, itemsCreator: function (options, callback) { + if (options.times === 1) { + cacheItems = []; + } + + if (cacheItems.length > 0) { + var renderedItems = cacheItems.slice(0, 100); + cacheItems = cacheItems.slice(100); + self.hasNext = true; + if (cacheItems.length === 0) { + self.hasNext = false; + } + callback(self._createItems(renderedItems)); + return; + } opts.itemsCreator(options, function (ob) { self.hasNext = !!ob.hasNext; - callback(self._createItems(ob.items)); + var firstItemsCount = 100 + ob.items.length % 100; + if (ob.items.length > 100) { + cacheItems = ob.items.slice(100 + ob.items.length % 100); + self.hasNext = true; + } + callback(self._createItems(ob.items.slice(0, firstItemsCount))); }); }, hasNext: function () { diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 47f34a729..c2c2d8de7 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }]); return false; } - this.options.items = (items || []).slice(0, 100); + this.options.items = (items || []).slice(0, 100 + (items || []).length % 100); this.times = 1; this.count = 0; this.count += items.length; @@ -184,14 +184,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { populate: function (items, keyword) { if (this._populate.apply(this, arguments)) { this.cachItems = []; - if (items.length > 100) { - this.cachItems = items.slice(100); + var firstItemsCount = 100 + items.length % 100; + if (items.length > firstItemsCount) { + this.cachItems = items.slice(firstItemsCount); } var renderEngine = BI.Widget._renderEngine; BI.Widget.registerRenderEngine(BI.Element.renderEngine); this.cachGroup.populate.call(this.cachGroup, items, keyword); BI.Widget.registerRenderEngine(renderEngine); - this.button_group.populate.call(this.button_group, items.slice(0, 100), keyword); + this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword); } }, 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 +}