Browse Source

Merge pull request #57 in FUI/fineui from ~GUY/fineui:master to master

* commit '531014f290d463e394f34839113c29c91423e11a':
  add
  add
  加个删除tab项的方法
  add
  add
  add
  add
es6
guy 8 years ago
parent
commit
1057fc7a13
  1. 27
      bi/base.js
  2. 10
      bi/case.js
  3. 2
      demo/js/widget/demo.multiselectcombo.js
  4. 27
      docs/base.js
  5. 10
      docs/case.js
  6. 2
      docs/demo.js
  7. 11
      src/base/combination/tab.js
  8. 16
      src/base/table/table.resizable.cell.js
  9. 6
      src/case/combo/bubblecombo/combo.bubble.js
  10. 3
      src/case/loader/sort.list.js
  11. 1
      src/case/trigger/trigger.editor.js

27
bi/base.js

@ -4825,6 +4825,17 @@ BI.Tab = BI.inherit(BI.Widget, {
}
},
removeTab: function (cardname) {
var self = this, o = this.options;
BI.any(this.cardMap, function (name, card) {
if (BI.isEqual(name, (cardname + ""))) {
self.layout.deleteCardByName(name);
delete self.cardMap[name];
return true;
}
});
},
getSelect: function () {
return this.curr;
},
@ -32473,14 +32484,14 @@ BI.ResizableTableCell = BI.inherit(BI.Widget, {
function optimizeSize(s) {
var optSize = BI.clamp(s, o.minSize, o.maxSize || Number.MAX_VALUE);
if (o.suitableSize) {
if (Math.abs(o.suitableSize - optSize) < 5) {
optSize = o.suitableSize;
self.handler.element.addClass("suitable");
} else {
self.handler.element.removeClass("suitable");
}
}
// if (o.suitableSize) {
// if (Math.abs(o.suitableSize - optSize) < 5) {
// optSize = o.suitableSize;
// self.handler.element.addClass("suitable");
// } else {
// self.handler.element.removeClass("suitable");
// }
// }
return optSize;
}

10
bi/case.js

@ -4914,6 +4914,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
default:
break;
}
this.triangle && this.triangle.destroy();
this.triangle = BI.createWidget(op, {
type: "bi.center_adapt",
cls: "button-combo-triangle-wrapper",
@ -4974,6 +4975,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
_hideTriangle: function () {
this.triangle && this.triangle.destroy();
this.triangle = null;
this.combo.getView() && this.combo.getView().hideLine();
},
@ -4986,10 +4988,6 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
this.combo && this.combo.showView();
},
hasView: function () {
return BI.isNotNull(this.combo.getView());
},
isViewVisible: function () {
return this.combo.isViewVisible();
}
@ -9138,6 +9136,9 @@ BI.SortList = BI.inherit(BI.Widget, {
},
populate: function (items) {
if (items) {
arguments[0] = this._formatItems(items);
}
this.loader.populate.apply(this.loader, arguments);
},
@ -12346,6 +12347,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
},
width: o.triggerWidth

2
demo/js/widget/demo.multiselectcombo.js

@ -35,7 +35,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.MULTI_COMBO_ITEMS;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);

27
docs/base.js

@ -4825,6 +4825,17 @@ BI.Tab = BI.inherit(BI.Widget, {
}
},
removeTab: function (cardname) {
var self = this, o = this.options;
BI.any(this.cardMap, function (name, card) {
if (BI.isEqual(name, (cardname + ""))) {
self.layout.deleteCardByName(name);
delete self.cardMap[name];
return true;
}
});
},
getSelect: function () {
return this.curr;
},
@ -32473,14 +32484,14 @@ BI.ResizableTableCell = BI.inherit(BI.Widget, {
function optimizeSize(s) {
var optSize = BI.clamp(s, o.minSize, o.maxSize || Number.MAX_VALUE);
if (o.suitableSize) {
if (Math.abs(o.suitableSize - optSize) < 5) {
optSize = o.suitableSize;
self.handler.element.addClass("suitable");
} else {
self.handler.element.removeClass("suitable");
}
}
// if (o.suitableSize) {
// if (Math.abs(o.suitableSize - optSize) < 5) {
// optSize = o.suitableSize;
// self.handler.element.addClass("suitable");
// } else {
// self.handler.element.removeClass("suitable");
// }
// }
return optSize;
}

10
docs/case.js

@ -4914,6 +4914,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
default:
break;
}
this.triangle && this.triangle.destroy();
this.triangle = BI.createWidget(op, {
type: "bi.center_adapt",
cls: "button-combo-triangle-wrapper",
@ -4974,6 +4975,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
_hideTriangle: function () {
this.triangle && this.triangle.destroy();
this.triangle = null;
this.combo.getView() && this.combo.getView().hideLine();
},
@ -4986,10 +4988,6 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
this.combo && this.combo.showView();
},
hasView: function () {
return BI.isNotNull(this.combo.getView());
},
isViewVisible: function () {
return this.combo.isViewVisible();
}
@ -9138,6 +9136,9 @@ BI.SortList = BI.inherit(BI.Widget, {
},
populate: function (items) {
if (items) {
arguments[0] = this._formatItems(items);
}
this.loader.populate.apply(this.loader, arguments);
},
@ -12346,6 +12347,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
},
width: o.triggerWidth

2
docs/demo.js

@ -5995,7 +5995,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.MULTI_COMBO_ITEMS;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);

11
src/base/combination/tab.js

@ -93,6 +93,17 @@ BI.Tab = BI.inherit(BI.Widget, {
}
},
removeTab: function (cardname) {
var self = this, o = this.options;
BI.any(this.cardMap, function (name, card) {
if (BI.isEqual(name, (cardname + ""))) {
self.layout.deleteCardByName(name);
delete self.cardMap[name];
return true;
}
});
},
getSelect: function () {
return this.curr;
},

16
src/base/table/table.resizable.cell.js

@ -30,14 +30,14 @@ BI.ResizableTableCell = BI.inherit(BI.Widget, {
function optimizeSize(s) {
var optSize = BI.clamp(s, o.minSize, o.maxSize || Number.MAX_VALUE);
if (o.suitableSize) {
if (Math.abs(o.suitableSize - optSize) < 5) {
optSize = o.suitableSize;
self.handler.element.addClass("suitable");
} else {
self.handler.element.removeClass("suitable");
}
}
// if (o.suitableSize) {
// if (Math.abs(o.suitableSize - optSize) < 5) {
// optSize = o.suitableSize;
// self.handler.element.addClass("suitable");
// } else {
// self.handler.element.removeClass("suitable");
// }
// }
return optSize;
}

6
src/case/combo/bubblecombo/combo.bubble.js

@ -129,6 +129,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
default:
break;
}
this.triangle && this.triangle.destroy();
this.triangle = BI.createWidget(op, {
type: "bi.center_adapt",
cls: "button-combo-triangle-wrapper",
@ -189,6 +190,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
_hideTriangle: function () {
this.triangle && this.triangle.destroy();
this.triangle = null;
this.combo.getView() && this.combo.getView().hideLine();
},
@ -201,10 +203,6 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
this.combo && this.combo.showView();
},
hasView: function () {
return BI.isNotNull(this.combo.getView());
},
isViewVisible: function () {
return this.combo.isViewVisible();
}

3
src/case/loader/sort.list.js

@ -114,6 +114,9 @@ BI.SortList = BI.inherit(BI.Widget, {
},
populate: function (items) {
if (items) {
arguments[0] = this._formatItems(items);
}
this.loader.populate.apply(this.loader, arguments);
},

1
src/case/trigger/trigger.editor.js

@ -55,6 +55,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
},
width: o.triggerWidth

Loading…
Cancel
Save