Browse Source

Pull request #2328: 无jira任务 virtualgroup layouts

Merge in VISUAL/fineui from ~IMP/fineui_fui:master to master

* commit 'd25385b4f349c4af141c7e206b0f8650b10de4ee':
  无jira任务 virtualgroup layouts
es6
imp 3 years ago
parent
commit
137ccb0566
  1. 12
      src/base/combination/group.virtual.js

12
src/base/combination/group.virtual.js

@ -22,12 +22,13 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
_packageBtns: function (items) { _packageBtns: function (items) {
var o = this.options; var o = this.options;
var map = this.buttonMap = {}; var map = this.buttonMap = {};
for (var i = o.layouts.length - 1; i > 0; i--) { var layouts = BI.isArray(o.layouts) ? o.layouts : [o.layouts];
for (var i = layouts.length - 1; i > 0; i--) {
items = BI.map(items, function (k, it) { items = BI.map(items, function (k, it) {
var el = BI.stripEL(it); var el = BI.stripEL(it);
return BI.extend({}, o.layouts[i], { return BI.extend({}, layouts[i], {
items: [ items: [
BI.extend({}, o.layouts[i].el, { BI.extend({}, layouts[i].el, {
el: BI.extend({ el: BI.extend({
ref: function (_ref) { ref: function (_ref) {
if (BI.isKey(map[el.value])) { if (BI.isKey(map[el.value])) {
@ -44,7 +45,9 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
}, },
_packageLayout: function (items) { _packageLayout: function (items) {
var o = this.options, layout = BI.deepClone(o.layouts[0]); var o = this.options;
var layouts = BI.isArray(o.layouts) ? o.layouts : [o.layouts];
var layout = BI.deepClone(layouts[0]);
var lay = BI.formatEL(layout).el; var lay = BI.formatEL(layout).el;
while (lay && lay.items && !BI.isEmpty(lay.items)) { while (lay && lay.items && !BI.isEmpty(lay.items)) {
@ -100,7 +103,6 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
}, },
populate: function (items) { populate: function (items) {
var self = this;
items = items || []; items = items || [];
this.options.items = items; this.options.items = items;
items = this._packageBtns(items); items = this._packageBtns(items);

Loading…
Cancel
Save