guy 8 years ago
parent
commit
06ac373822
  1. 8
      dist/base.js
  2. 26
      dist/core.js
  3. 8
      src/base/combination/group.button.js
  4. 15
      src/core/wrapper/layout.js
  5. 11
      src/core/wrapper/layout/layout.card.js

8
dist/base.js vendored

@ -21353,8 +21353,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
return;
}
var items = this._packageItems(items, this._packageBtns(btns));
BI.createWidget(BI.extend(this._packageLayout(items))).element.children().prependTo(this.element);
items = this._packageItems(items, this._packageBtns(btns));
this.layouts.prependItems(this._packageLayout(items).items);
},
addItems: function (items) {
@ -21369,8 +21369,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
return;
}
var items = this._packageItems(items, this._packageBtns(btns));
BI.createWidget(BI.extend(this._packageLayout(items))).element.children().appendTo(this.element);
items = this._packageItems(items, this._packageBtns(btns));
this.layouts.addItems(this._packageLayout(items).items);
},
removeItemAt: function (indexes) {

26
dist/core.js vendored

@ -19363,6 +19363,14 @@ BI.Layout = BI.inherit(BI.Widget, {
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.unshift(item);
w.element.prependTo(this.element);
return w;
},
addItems: function (items) {
var self = this;
BI.each(items, function (i, item) {
@ -19370,6 +19378,13 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
prependItems: function (items) {
var self = this;
BI.each(items, function (i, item) {
self.prependItem(item);
})
},
getValue: function () {
var value = [];
BI.each(this._children, function (i, wi) {
@ -26630,7 +26645,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
return widget;
},
showCardByName: function (name, action) {
showCardByName: function (name, action, callback) {
var self = this;
//name不存在的时候全部隐藏
var exist = this.hasWidget(this._getCardName(name));
@ -26644,7 +26659,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
//动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了
!flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible();
} else {
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), el._mount())
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), callback && callback())
}
});
},
@ -26653,12 +26668,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
var self = this;
this.showIndex = this.lastShowIndex;
BI.each(this._children, function (i, el) {
if (self.showIndex != i) {
el.element.hide();
} else {
el.element.show();
el._mount();
}
el.setVisible(self.showIndex == i);
})
},

8
src/base/combination/group.button.js

@ -126,8 +126,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
return;
}
var items = this._packageItems(items, this._packageBtns(btns));
BI.createWidget(BI.extend(this._packageLayout(items))).element.children().prependTo(this.element);
items = this._packageItems(items, this._packageBtns(btns));
this.layouts.prependItems(this._packageLayout(items).items);
},
addItems: function (items) {
@ -142,8 +142,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
return;
}
var items = this._packageItems(items, this._packageBtns(btns));
BI.createWidget(BI.extend(this._packageLayout(items))).element.children().appendTo(this.element);
items = this._packageItems(items, this._packageBtns(btns));
this.layouts.addItems(this._packageLayout(items).items);
},
removeItemAt: function (indexes) {

15
src/core/wrapper/layout.js

@ -106,6 +106,14 @@ BI.Layout = BI.inherit(BI.Widget, {
return w;
},
prependItem: function (item) {
var w = this._addElement(this.options.items.length, item);
w._mount();
this.options.items.unshift(item);
w.element.prependTo(this.element);
return w;
},
addItems: function (items) {
var self = this;
BI.each(items, function (i, item) {
@ -113,6 +121,13 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
prependItems: function (items) {
var self = this;
BI.each(items, function (i, item) {
self.prependItem(item);
})
},
getValue: function () {
var value = [];
BI.each(this._children, function (i, wi) {

11
src/core/wrapper/layout/layout.card.js

@ -86,7 +86,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
return widget;
},
showCardByName: function (name, action) {
showCardByName: function (name, action, callback) {
var self = this;
//name不存在的时候全部隐藏
var exist = this.hasWidget(this._getCardName(name));
@ -100,7 +100,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
//动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了
!flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible();
} else {
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), el._mount())
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), callback && callback())
}
});
},
@ -109,12 +109,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
var self = this;
this.showIndex = this.lastShowIndex;
BI.each(this._children, function (i, el) {
if (self.showIndex != i) {
el.element.hide();
} else {
el.element.show();
el._mount();
}
el.setVisible(self.showIndex == i);
})
},

Loading…
Cancel
Save