Browse Source

KERNEL-12408:base中eslint的修改

es6
chaos0156 2 years ago
parent
commit
3e6f88cab1
  1. 3
      .eslintrc
  2. 6
      src/base/collection/collection.js
  3. 4
      src/base/combination/bubble.js
  4. 4
      src/base/combination/expander.js
  5. 2
      src/base/combination/group.button.js
  6. 2
      src/base/combination/group.combo.js
  7. 2
      src/base/combination/group.virtual.js
  8. 6
      src/base/combination/loader.js
  9. 2
      src/base/combination/navigation.js
  10. 2
      src/base/combination/tab.js
  11. 6
      src/base/foundation/message.js
  12. 6
      src/base/grid/grid.js
  13. 2
      src/base/layer/layer.drawer.js
  14. 2
      src/base/layer/layer.popover.js
  15. 10
      src/base/layer/layer.popup.js
  16. 6
      src/base/single/1.text.js
  17. 33
      src/base/single/button/button.basic.js
  18. 5
      src/base/single/button/button.node.js
  19. 12
      src/base/single/button/node/__test__/icontexticonnode.test.js
  20. 12
      src/base/single/button/node/__test__/icontextnode.test.js
  21. 12
      src/base/single/button/node/__test__/texticonnode.test.js
  22. 15
      src/base/single/button/node/__test__/textnode.test.js
  23. 15
      src/base/single/button/node/icontexticonnode.js
  24. 13
      src/base/single/button/node/icontextnode.js
  25. 13
      src/base/single/button/node/texticonnode.js
  26. 9
      src/base/single/button/node/textnode.js
  27. 23
      src/base/single/editor/editor.js
  28. 11
      src/base/single/editor/editor.multifile.js
  29. 5
      src/base/single/html/__test__/html.test.js
  30. 18
      src/base/single/html/html.js
  31. 5
      src/base/single/icon/icon.js
  32. 3
      src/base/single/iframe/__test__/iframe.test.js
  33. 7
      src/base/single/iframe/iframe.js
  34. 3
      src/base/single/img/__test__/img.test.js
  35. 7
      src/base/single/img/img.js
  36. 5
      src/base/single/input/checkbox/checkbox.image.js
  37. 9
      src/base/single/input/checkbox/checkbox.js
  38. 35
      src/base/single/input/input.js
  39. 5
      src/base/single/input/radio/radio.image.js
  40. 9
      src/base/single/input/radio/radio.js
  41. 2
      src/base/single/tip/0.tip.js
  42. 2
      src/base/tree/customtree.js

3
.eslintrc

@ -31,7 +31,8 @@
"rules": { "rules": {
"no-param-reassign": "off", "no-param-reassign": "off",
"quotes": [2, "double"], "quotes": [2, "double"],
"comma-dangle": ["error", { "arrays": "never", "objects": "always"}], // 多行对象字面量中要求拖尾逗号 "comma-dangle": ["error", { "arrays": "never", "objects": "always-multiline"}] // 多行对象字面量中要求拖尾逗号
// "no-empty": ["error",{"allowEmptyCatch":"true"}]
} }
}, { }, {
"files": ["webpack/*.js", "./*.js", "lib/**/*.js", "lib/*.js", "./bin/*.js", "./bin/**/*.js"], "files": ["webpack/*.js", "./*.js", "lib/**/*.js", "lib/*.js", "./bin/*.js", "./bin/**/*.js"],

6
src/base/collection/collection.js

@ -282,7 +282,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
var minY = BI.max(topBorder); var minY = BI.max(topBorder);
var maxY = BI.min(bottomBorder); var maxY = BI.min(bottomBorder);
this.renderRange = { minX: minX, minY: minY, maxX: maxX, maxY: maxY, }; this.renderRange = { minX: minX, minY: minY, maxX: maxX, maxY: maxY };
} }
}, },
@ -341,7 +341,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
this.options.overflowX = !!b; this.options.overflowX = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({ overflowX: b ? "auto" : "hidden", }); self.element.css({ overflowX: b ? "auto" : "hidden" });
}); });
} }
}, },
@ -351,7 +351,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
if (this.options.overflowY !== !!b) { if (this.options.overflowY !== !!b) {
this.options.overflowY = !!b; this.options.overflowY = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({ overflowY: b ? "auto" : "hidden", }); self.element.css({ overflowY: b ? "auto" : "hidden" });
}); });
} }
}, },

4
src/base/combination/bubble.js

@ -85,7 +85,7 @@
element: this, element: this,
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, { }, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, {
items: [ items: [
{ el: this.combo, } { el: this.combo }
], ],
})))); }))));
o.isDefaultInit && (this._assertPopupView()); o.isDefaultInit && (this._assertPopupView());
@ -260,7 +260,7 @@
scrolly: false, scrolly: false,
element: this.options.container || this, element: this.options.container || this,
items: [ items: [
{ el: this.popupView, } { el: this.popupView }
], ],
}); });
this._rendered = true; this._rendered = true;

4
src/base/combination/expander.js

@ -65,7 +65,7 @@ BI.Expander = BI.inherit(BI.Widget, {
scrolly: false, scrolly: false,
element: this, element: this,
items: [ items: [
{ el: this.expander, } { el: this.expander }
], ],
}); });
o.isDefaultInit && this._assertPopupView(); o.isDefaultInit && this._assertPopupView();
@ -171,7 +171,7 @@ BI.Expander = BI.inherit(BI.Widget, {
scrolly: false, scrolly: false,
element: this, element: this,
items: [ items: [
{ el: this.popupView, } { el: this.popupView }
], ],
}); });
this._rendered = true; this._rendered = true;

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

@ -203,7 +203,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
items = this._packageItems(items, this._packageBtns(this.buttons)); items = this._packageItems(items, this._packageBtns(this.buttons));
} }
this.layouts = BI.createWidget(BI.extend({ element: this, }, this._packageLayout(items))); this.layouts = BI.createWidget(BI.extend({ element: this }, this._packageLayout(items)));
}, },
setNotSelectedValue: function (v) { setNotSelectedValue: function (v) {

2
src/base/combination/group.combo.js

@ -15,7 +15,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
isNeedAdjustHeight: false, isNeedAdjustHeight: false,
isNeedAdjustWidth: false, isNeedAdjustWidth: false,
el: { type: "bi.text_button", text: "", value: "", }, el: { type: "bi.text_button", text: "", value: "" },
items: [], items: [],
popup: { popup: {

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

@ -132,7 +132,7 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
this.options.items = items; this.options.items = items;
items = this._packageBtns(items); items = this._packageBtns(items);
if (!this.layouts) { if (!this.layouts) {
this.layouts = BI.createWidget(BI.extend({ element: this, }, this._packageLayout(items))); this.layouts = BI.createWidget(BI.extend({ element: this }, this._packageLayout(items)));
} else { } else {
this.layouts.populate(items, { this.layouts.populate(items, {
context: this, context: this,

6
src/base/combination/loader.js

@ -38,7 +38,7 @@ BI.Loader = BI.inherit(BI.Widget, {
_prevLoad: function () { _prevLoad: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.prev.setLoading(); this.prev.setLoading();
o.itemsCreator.apply(this, [{ times: --this.times, }, function () { o.itemsCreator.apply(this, [{ times: --this.times }, function () {
self.prev.setLoaded(); self.prev.setLoaded();
self.prependItems.apply(self, arguments); self.prependItems.apply(self, arguments);
}]); }]);
@ -47,7 +47,7 @@ BI.Loader = BI.inherit(BI.Widget, {
_nextLoad: function () { _nextLoad: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.next.setLoading(); this.next.setLoading();
o.itemsCreator.apply(this, [{ times: ++this.times, }, function () { o.itemsCreator.apply(this, [{ times: ++this.times }, function () {
self.next.setLoaded(); self.next.setLoaded();
self.addItems.apply(self, arguments); self.addItems.apply(self, arguments);
}]); }]);
@ -170,7 +170,7 @@ BI.Loader = BI.inherit(BI.Widget, {
_populate: function (items) { _populate: function (items) {
var self = this, o = this.options; var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) { if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{ times: 1, }, function () { o.itemsCreator.apply(this, [{ times: 1 }, function () {
if (arguments.length === 0) { if (arguments.length === 0) {
throw new Error("参数不能为空"); throw new Error("参数不能为空");
} }

2
src/base/combination/navigation.js

@ -23,7 +23,7 @@ BI.Navigation = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
this.tab = BI.createWidget(this.options.tab, { type: "bi.button_group", }); this.tab = BI.createWidget(this.options.tab, { type: "bi.button_group" });
this.cardMap = {}; this.cardMap = {};
this.showIndex = 0; this.showIndex = 0;
this.layout = BI.createWidget({ this.layout = BI.createWidget({

2
src/base/combination/tab.js

@ -23,7 +23,7 @@ BI.Tab = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
if (BI.isObject(o.tab)) { if (BI.isObject(o.tab)) {
this.tab = BI.createWidget(this.options.tab, { type: "bi.button_group", }); this.tab = BI.createWidget(this.options.tab, { type: "bi.button_group" });
this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });

6
src/base/foundation/message.js

@ -21,7 +21,7 @@ BI.Msg = ((function () {
// BI.Msg.prompt(title, message, value, callback, min_width); // BI.Msg.prompt(title, message, value, callback, min_width);
}, },
toast: function (message, options, context) { toast: function (message, options, context) {
BI.isString(options) && (options = { level: options, }); BI.isString(options) && (options = { level: options });
options = options || {}; options = options || {};
context = context || BI.Widget._renderEngine.createElement("body"); context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "common"; var level = options.level || "common";
@ -40,7 +40,7 @@ BI.Msg = ((function () {
BI.remove(toastStack, toast.element); BI.remove(toastStack, toast.element);
var _height = BI.SIZE_CONSANTS.TOAST_TOP; var _height = BI.SIZE_CONSANTS.TOAST_TOP;
BI.each(toastStack, function (i, element) { BI.each(toastStack, function (i, element) {
element.css({ "top": _height, }); element.css({ "top": _height });
_height += element.outerHeight() + 10; _height += element.outerHeight() + 10;
}); });
callback(); callback();
@ -61,7 +61,7 @@ BI.Msg = ((function () {
}], }],
}); });
toastStack.push(toast.element); toastStack.push(toast.element);
toast.element.css({ "margin-left": -1 * toast.element.outerWidth() / 2, }); toast.element.css({ "margin-left": -1 * toast.element.outerWidth() / 2 });
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"); toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () { autoClose && BI.delay(function () {

6
src/base/grid/grid.js

@ -258,7 +258,7 @@ BI.GridView = BI.inherit(BI.Widget, {
this.container.attr("items", renderedCells); this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;
this.renderRange = { minX: minX, minY: minY, maxX: maxX, maxY: maxY, }; this.renderRange = { minX: minX, minY: minY, maxX: maxX, maxY: maxY };
} }
}, },
@ -333,7 +333,7 @@ BI.GridView = BI.inherit(BI.Widget, {
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
this.options.overflowX = !!b; this.options.overflowX = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({ overflowX: b ? "auto" : "hidden", }); self.element.css({ overflowX: b ? "auto" : "hidden" });
}); });
} }
}, },
@ -343,7 +343,7 @@ BI.GridView = BI.inherit(BI.Widget, {
if (this.options.overflowY !== !!b) { if (this.options.overflowY !== !!b) {
this.options.overflowY = !!b; this.options.overflowY = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({ overflowY: b ? "auto" : "hidden", }); self.element.css({ overflowY: b ? "auto" : "hidden" });
}); });
} }
}, },

2
src/base/layer/layer.drawer.js

@ -227,7 +227,7 @@ BI.Drawer = BI.inherit(BI.Widget, {
}, },
setZindex: function (zindex) { setZindex: function (zindex) {
this.element.css({ "z-index": zindex, }); this.element.css({ "z-index": zindex });
}, },
destroyed: function () { destroyed: function () {

2
src/base/layer/layer.popover.js

@ -222,7 +222,7 @@ BI.Popover = BI.inherit(BI.Widget, {
}, },
setZindex: function (zindex) { setZindex: function (zindex) {
this.element.css({ "z-index": zindex, }); this.element.css({ "z-index": zindex });
}, },
destroyed: function () { destroyed: function () {

10
src/base/layer/layer.popup.js

@ -62,12 +62,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
"z-index": BI.zIndex_popup, "z-index": BI.zIndex_popup,
"min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth, "min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth,
"max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth, "max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth,
}).bind({ click: fn, }); }).bind({ click: fn });
this.element.bind("mousewheel", fn); this.element.bind("mousewheel", fn);
o.stopPropagation && this.element.bind({ mousedown: fn, mouseup: fn, mouseover: fn, }); o.stopPropagation && this.element.bind({ mousedown: fn, mouseup: fn, mouseover: fn });
o.stopEvent && this.element.bind({ mousedown: stop, mouseup: stop, mouseover: stop, }); o.stopEvent && this.element.bind({ mousedown: stop, mouseup: stop, mouseover: stop });
this.tool = this._createTool(); this.tool = this._createTool();
this.tab = this._createTab(); this.tab = this._createTab();
this.view = this._createView(); this.view = this._createView();
@ -133,7 +133,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
_createView: function () { _createView: function () {
var o = this.options; var o = this.options;
this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value, }); this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value });
this.button_group.element.css({ this.button_group.element.css({
"min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight, "min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight,
"padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit, "padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit,
@ -411,7 +411,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap; var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap;
this.view.resetHeight ? this.view.resetHeight(resetHeight) : this.view.resetHeight ? this.view.resetHeight(resetHeight) :
this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit, }); this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit });
}, },
setValue: function (selectedValues) { setValue: function (selectedValues) {

6
src/base/single/1.text.js

@ -45,13 +45,13 @@
}); });
} }
if (BI.isWidthOrHeight(o.height)) { if (BI.isWidthOrHeight(o.height)) {
this.element.css({ lineHeight: BI.isNumber(o.height) ? (o.height / BI.pixRatio + BI.pixUnit) : o.height, }); this.element.css({ lineHeight: BI.isNumber(o.height) ? (o.height / BI.pixRatio + BI.pixUnit) : o.height });
} }
if (BI.isWidthOrHeight(o.lineHeight)) { if (BI.isWidthOrHeight(o.lineHeight)) {
this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? (o.lineHeight / BI.pixRatio + BI.pixUnit) : o.lineHeight, }); this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? (o.lineHeight / BI.pixRatio + BI.pixUnit) : o.lineHeight });
} }
if (BI.isWidthOrHeight(o.maxWidth)) { if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth, }); this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth });
} }
this.element.css({ this.element.css({
textAlign: o.textAlign, textAlign: o.textAlign,

33
src/base/single/button/button.basic.js

@ -8,6 +8,7 @@
BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.BasicButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.BasicButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""), _baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
// el: {} // 可以通过el来创建button元素 // el: {} // 可以通过el来创建button元素
@ -24,7 +25,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
isShadowShowingOnSelected: false, // 选中状态下是否显示阴影 isShadowShowingOnSelected: false, // 选中状态下是否显示阴影
trigger: null, trigger: null,
handler: BI.emptyFn, handler: BI.emptyFn,
bubble: null bubble: null,
}); });
}, },
@ -63,11 +64,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
_createShadow: function () { _createShadow: function () {
var self = this, o = this.options; var self = this, o = this.options;
var assertMask = function () { function assertMask() {
if (!self.$mask) { if (!self.$mask) {
self.$mask = BI.createWidget(BI.isObject(o.shadow) ? o.shadow : {}, { self.$mask = BI.createWidget(BI.isObject(o.shadow) ? o.shadow : {}, {
type: "bi.layout", type: "bi.layout",
cls: "bi-button-mask" cls: "bi-button-mask",
}); });
self.$mask.invisible(); self.$mask.invisible();
BI.createWidget({ BI.createWidget({
@ -78,11 +79,11 @@ BI.BasicButton = BI.inherit(BI.Single, {
left: 0, left: 0,
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0,
}] }],
}); });
} }
}; }
this.element.mouseup(function () { this.element.mouseup(function () {
if (!self._hover && !o.isShadowShowingOnSelected) { if (!self._hover && !o.isShadowShowingOnSelected) {
@ -223,7 +224,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
// 之后的300ms点击无效 // 之后的300ms点击无效
var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, { var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, {
"leading": true, "leading": true,
"trailing": false "trailing": false,
}); });
function ev(e) { function ev(e) {
@ -257,7 +258,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
}, },
el: { el: {
type: "bi.layout", type: "bi.layout",
height: "100%" height: "100%",
}, },
popup: { popup: {
type: "bi.text_bubble_bar_popup_view", type: "bi.text_bubble_bar_popup_view",
@ -272,21 +273,21 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (v) { if (v) {
onClick.apply(self, arguments); onClick.apply(self, arguments);
} }
} },
}] }],
}, },
listeners: [{ listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW, eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () { action: function () {
popup.populate(getBubble()); popup.populate(getBubble());
} },
}] }],
}, },
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
top: 0 top: 0,
}] }],
}); });
} }
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
@ -294,6 +295,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
} else { } else {
self.combo.showView(); self.combo.showView();
} }
return; return;
} }
onClick.apply(self, arguments); onClick.apply(self, arguments);
@ -304,6 +306,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
if (BI.isFunction(bubble)) { if (BI.isFunction(bubble)) {
return bubble(); return bubble();
} }
return bubble; return bubble;
} }
}, },
@ -436,7 +439,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
empty: function () { empty: function () {
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments); BI.BasicButton.superclass.empty.apply(this, arguments);
} },
}); });
BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";
BI.shortcut("bi.basic_button", BI.BasicButton); BI.shortcut("bi.basic_button", BI.BasicButton);

5
src/base/single/button/button.node.js

@ -9,9 +9,10 @@
BI.NodeButton = BI.inherit(BI.BasicButton, { BI.NodeButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-node", _baseCls: (conf._baseCls || "") + " bi-node",
open: false open: false,
}); });
}, },
@ -51,6 +52,6 @@ BI.NodeButton = BI.inherit(BI.BasicButton, {
this.setOpened(true); this.setOpened(true);
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this);
} }
} },
}); });
BI.shortcut("bi.node_button", BI.NodeButton); BI.shortcut("bi.node_button", BI.NodeButton);

12
src/base/single/button/node/__test__/icontexticonnode.test.js

@ -4,13 +4,12 @@
*/ */
describe("IconTextIconNodeTest", function () { describe("IconTextIconNodeTest", function () {
/** /**
* test_author_kobi * test_author_kobi
*/ */
it("setText", function () { it("setText", function () {
var iconTextIconNode = BI.Test.createWidget({ var iconTextIconNode = BI.Test.createWidget({
type: "bi.icon_text_icon_node" type: "bi.icon_text_icon_node",
}); });
iconTextIconNode.setText("AAA"); iconTextIconNode.setText("AAA");
expect(iconTextIconNode.element.find(".bi-text").text()).to.equal("AAA"); expect(iconTextIconNode.element.find(".bi-text").text()).to.equal("AAA");
@ -34,7 +33,7 @@ describe("IconTextIconNodeTest", function () {
*/ */
it("setValue", function () { it("setValue", function () {
var iconTextIconNode = BI.Test.createWidget({ var iconTextIconNode = BI.Test.createWidget({
type: "bi.icon_text_icon_node" type: "bi.icon_text_icon_node",
}); });
iconTextIconNode.setValue("AAA"); iconTextIconNode.setValue("AAA");
expect(iconTextIconNode.element.find(".bi-text").text()).to.equal("AAA"); expect(iconTextIconNode.element.find(".bi-text").text()).to.equal("AAA");
@ -48,7 +47,7 @@ describe("IconTextIconNodeTest", function () {
var iconTextIconNode = BI.Test.createWidget({ var iconTextIconNode = BI.Test.createWidget({
type: "bi.icon_text_icon_node", type: "bi.icon_text_icon_node",
value: "AAA", value: "AAA",
readonly: true readonly: true,
}); });
iconTextIconNode.setValue("BBB"); iconTextIconNode.setValue("BBB");
expect(iconTextIconNode.element.find(".bi-text").text()).to.equal("AAA"); expect(iconTextIconNode.element.find(".bi-text").text()).to.equal("AAA");
@ -61,7 +60,7 @@ describe("IconTextIconNodeTest", function () {
it("getValue", function () { it("getValue", function () {
var iconTextIconNode = BI.Test.createWidget({ var iconTextIconNode = BI.Test.createWidget({
type: "bi.icon_text_icon_node", type: "bi.icon_text_icon_node",
value: "AAA" value: "AAA",
}); });
expect(iconTextIconNode.getValue()).to.equal("AAA"); expect(iconTextIconNode.getValue()).to.equal("AAA");
iconTextIconNode.destroy(); iconTextIconNode.destroy();
@ -91,7 +90,7 @@ describe("IconTextIconNodeTest", function () {
text: "AAA", text: "AAA",
handler: function () { handler: function () {
this.setText("click"); this.setText("click");
} },
}); });
BI.nextTick(function () { BI.nextTick(function () {
iconTextIconNode.element.click(); iconTextIconNode.element.click();
@ -100,5 +99,4 @@ describe("IconTextIconNodeTest", function () {
done(); done();
}); });
}); });
}); });

12
src/base/single/button/node/__test__/icontextnode.test.js

@ -4,13 +4,12 @@
*/ */
describe("IconTextNodeTest", function () { describe("IconTextNodeTest", function () {
/** /**
* test_author_kobi * test_author_kobi
*/ */
it("setText", function () { it("setText", function () {
var iconTextNode = BI.Test.createWidget({ var iconTextNode = BI.Test.createWidget({
type: "bi.icon_text_node" type: "bi.icon_text_node",
}); });
iconTextNode.setText("AAA"); iconTextNode.setText("AAA");
expect(iconTextNode.element.find(".bi-text").text()).to.equal("AAA"); expect(iconTextNode.element.find(".bi-text").text()).to.equal("AAA");
@ -34,7 +33,7 @@ describe("IconTextNodeTest", function () {
*/ */
it("setValue", function () { it("setValue", function () {
var iconTextNode = BI.Test.createWidget({ var iconTextNode = BI.Test.createWidget({
type: "bi.icon_text_node" type: "bi.icon_text_node",
}); });
iconTextNode.setValue("AAA"); iconTextNode.setValue("AAA");
expect(iconTextNode.element.find(".bi-text").text()).to.equal("AAA"); expect(iconTextNode.element.find(".bi-text").text()).to.equal("AAA");
@ -48,7 +47,7 @@ describe("IconTextNodeTest", function () {
var iconTextNode = BI.Test.createWidget({ var iconTextNode = BI.Test.createWidget({
type: "bi.icon_text_node", type: "bi.icon_text_node",
value: "AAA", value: "AAA",
readonly: true readonly: true,
}); });
iconTextNode.setValue("BBB"); iconTextNode.setValue("BBB");
expect(iconTextNode.element.find(".bi-text").text()).to.equal("AAA"); expect(iconTextNode.element.find(".bi-text").text()).to.equal("AAA");
@ -61,7 +60,7 @@ describe("IconTextNodeTest", function () {
it("getValue", function () { it("getValue", function () {
var iconTextNode = BI.Test.createWidget({ var iconTextNode = BI.Test.createWidget({
type: "bi.icon_text_node", type: "bi.icon_text_node",
value: "AAA" value: "AAA",
}); });
expect(iconTextNode.getValue()).to.equal("AAA"); expect(iconTextNode.getValue()).to.equal("AAA");
iconTextNode.destroy(); iconTextNode.destroy();
@ -91,7 +90,7 @@ describe("IconTextNodeTest", function () {
text: "AAA", text: "AAA",
handler: function () { handler: function () {
this.setText("click"); this.setText("click");
} },
}); });
BI.nextTick(function () { BI.nextTick(function () {
iconTextNode.element.click(); iconTextNode.element.click();
@ -100,5 +99,4 @@ describe("IconTextNodeTest", function () {
done(); done();
}); });
}); });
}); });

12
src/base/single/button/node/__test__/texticonnode.test.js

@ -4,13 +4,12 @@
*/ */
describe("TextIconNodeTest", function () { describe("TextIconNodeTest", function () {
/** /**
* test_author_kobi * test_author_kobi
*/ */
it("setText", function () { it("setText", function () {
var textIconNode = BI.Test.createWidget({ var textIconNode = BI.Test.createWidget({
type: "bi.text_icon_node" type: "bi.text_icon_node",
}); });
textIconNode.setText("AAA"); textIconNode.setText("AAA");
expect(textIconNode.element.find(".bi-text").text()).to.equal("AAA"); expect(textIconNode.element.find(".bi-text").text()).to.equal("AAA");
@ -34,7 +33,7 @@ describe("TextIconNodeTest", function () {
*/ */
it("setValue", function () { it("setValue", function () {
var textIconNode = BI.Test.createWidget({ var textIconNode = BI.Test.createWidget({
type: "bi.text_icon_node" type: "bi.text_icon_node",
}); });
textIconNode.setValue("AAA"); textIconNode.setValue("AAA");
expect(textIconNode.element.find(".bi-text").text()).to.equal("AAA"); expect(textIconNode.element.find(".bi-text").text()).to.equal("AAA");
@ -48,7 +47,7 @@ describe("TextIconNodeTest", function () {
var textIconNode = BI.Test.createWidget({ var textIconNode = BI.Test.createWidget({
type: "bi.text_icon_node", type: "bi.text_icon_node",
value: "AAA", value: "AAA",
readonly: true readonly: true,
}); });
textIconNode.setValue("BBB"); textIconNode.setValue("BBB");
expect(textIconNode.element.find(".bi-text").text()).to.equal("AAA"); expect(textIconNode.element.find(".bi-text").text()).to.equal("AAA");
@ -61,7 +60,7 @@ describe("TextIconNodeTest", function () {
it("getValue", function () { it("getValue", function () {
var textIconNode = BI.Test.createWidget({ var textIconNode = BI.Test.createWidget({
type: "bi.text_icon_node", type: "bi.text_icon_node",
value: "AAA" value: "AAA",
}); });
expect(textIconNode.getValue()).to.equal("AAA"); expect(textIconNode.getValue()).to.equal("AAA");
textIconNode.destroy(); textIconNode.destroy();
@ -91,7 +90,7 @@ describe("TextIconNodeTest", function () {
text: "AAA", text: "AAA",
handler: function () { handler: function () {
this.setText("click"); this.setText("click");
} },
}); });
BI.nextTick(function () { BI.nextTick(function () {
textIconNode.element.click(); textIconNode.element.click();
@ -100,5 +99,4 @@ describe("TextIconNodeTest", function () {
done(); done();
}); });
}); });
}); });

15
src/base/single/button/node/__test__/textnode.test.js

@ -4,13 +4,12 @@
*/ */
describe("TextNodeTest", function () { describe("TextNodeTest", function () {
/** /**
* test_author_kobi * test_author_kobi
*/ */
it("setText", function () { it("setText", function () {
var textNode = BI.Test.createWidget({ var textNode = BI.Test.createWidget({
type: "bi.text_node" type: "bi.text_node",
}); });
textNode.setText("AAA"); textNode.setText("AAA");
expect(textNode.element.children(".bi-text").text()).to.equal("AAA"); expect(textNode.element.children(".bi-text").text()).to.equal("AAA");
@ -24,7 +23,7 @@ describe("TextNodeTest", function () {
var textNode = BI.Test.createWidget({ var textNode = BI.Test.createWidget({
type: "bi.text_node", type: "bi.text_node",
text: "AAA", text: "AAA",
whiteSpace: "normal" whiteSpace: "normal",
}); });
expect(textNode.getText()).to.equal("AAA"); expect(textNode.getText()).to.equal("AAA");
textNode.destroy(); textNode.destroy();
@ -35,7 +34,7 @@ describe("TextNodeTest", function () {
*/ */
it("setValue", function () { it("setValue", function () {
var textNode = BI.Test.createWidget({ var textNode = BI.Test.createWidget({
type: "bi.text_node" type: "bi.text_node",
}); });
textNode.setValue("AAA"); textNode.setValue("AAA");
expect(textNode.element.children(".bi-text").text()).to.equal("AAA"); expect(textNode.element.children(".bi-text").text()).to.equal("AAA");
@ -49,7 +48,7 @@ describe("TextNodeTest", function () {
var textNode = BI.Test.createWidget({ var textNode = BI.Test.createWidget({
type: "bi.text_node", type: "bi.text_node",
value: "AAA", value: "AAA",
readonly: true readonly: true,
}); });
textNode.setValue("BBB"); textNode.setValue("BBB");
expect(textNode.element.children(".bi-text").text()).to.equal("AAA"); expect(textNode.element.children(".bi-text").text()).to.equal("AAA");
@ -62,7 +61,7 @@ describe("TextNodeTest", function () {
it("getValue", function () { it("getValue", function () {
var textNode = BI.Test.createWidget({ var textNode = BI.Test.createWidget({
type: "bi.text_node", type: "bi.text_node",
value: "AAA" value: "AAA",
}); });
expect(textNode.getValue()).to.equal("AAA"); expect(textNode.getValue()).to.equal("AAA");
textNode.destroy(); textNode.destroy();
@ -92,7 +91,7 @@ describe("TextNodeTest", function () {
text: "AAA", text: "AAA",
handler: function () { handler: function () {
this.setText("click"); this.setText("click");
} },
}); });
BI.nextTick(function () { BI.nextTick(function () {
textNode.element.click(); textNode.element.click();
@ -101,6 +100,4 @@ describe("TextNodeTest", function () {
done(); done();
}); });
}); });
}); });

15
src/base/single/button/node/icontexticonnode.js

@ -8,6 +8,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node", baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node",
iconCls1: "close-ha-font", iconCls1: "close-ha-font",
@ -17,7 +18,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
textHgap: 0, textHgap: 0,
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0,
}); });
}, },
@ -33,7 +34,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
width: o.leftIconWrapperWidth || o.height, width: o.leftIconWrapperWidth || o.height,
height: o.height, height: o.height,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight,
}, { }, {
el: { el: {
type: "bi.label", type: "bi.label",
@ -48,16 +49,16 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
text: o.text, text: o.text,
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height,
} },
}, { }, {
type: "bi.icon_label", type: "bi.icon_label",
cls: o.iconCls2, cls: o.iconCls2,
width: o.rightIconWrapperWidth || o.height, width: o.rightIconWrapperWidth || o.height,
height: o.height, height: o.height,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight,
}] }],
}; };
}, },
@ -92,7 +93,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
getText: function () { getText: function () {
return this.text.getText(); return this.text.getText();
} },
}); });
BI.IconTextIconNode.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextIconNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_icon_node", BI.IconTextIconNode); BI.shortcut("bi.icon_text_icon_node", BI.IconTextIconNode);

13
src/base/single/button/node/icontextnode.js

@ -8,6 +8,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-node", baseCls: (conf.baseCls || "") + " bi-icon-text-node",
cls: "close-ha-font", cls: "close-ha-font",
@ -16,7 +17,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
textHgap: 0, textHgap: 0,
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0,
}); });
}, },
@ -32,7 +33,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
width: o.iconWrapperWidth || o.height, width: o.iconWrapperWidth || o.height,
height: o.height, height: o.height,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight,
}, { }, {
el: { el: {
type: "bi.label", type: "bi.label",
@ -48,9 +49,9 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
text: o.text, text: o.text,
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height,
} },
}] }],
}; };
}, },
@ -85,7 +86,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
unRedMark: function () { unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments); this.text.unRedMark.apply(this.text, arguments);
} },
}); });
BI.IconTextNode.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_node", BI.IconTextNode); BI.shortcut("bi.icon_text_node", BI.IconTextNode);

13
src/base/single/button/node/texticonnode.js

@ -7,6 +7,7 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-node", baseCls: (conf.baseCls || "") + " bi-text-icon-node",
cls: "close-ha-font", cls: "close-ha-font",
@ -15,7 +16,7 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
textHgap: 0, textHgap: 0,
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0,
}); });
}, },
@ -40,16 +41,16 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
text: o.text, text: o.text,
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height,
} },
}, { }, {
type: "bi.icon_label", type: "bi.icon_label",
cls: o.iconCls, cls: o.iconCls,
width: o.iconWrapperWidth || o.height, width: o.iconWrapperWidth || o.height,
height: o.height, height: o.height,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight,
}] }],
}; };
}, },
@ -84,7 +85,7 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
unRedMark: function () { unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments); this.text.unRedMark.apply(this.text, arguments);
} },
}); });
BI.TextIconNode.EVENT_CHANGE = "EVENT_CHANGE"; BI.TextIconNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_icon_node", BI.TextIconNode); BI.shortcut("bi.text_icon_node", BI.TextIconNode);

9
src/base/single/button/node/textnode.js

@ -9,6 +9,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TextNode.superclass._defaultConfig.apply(this, arguments); var conf = BI.TextNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-node", baseCls: (conf.baseCls || "") + " bi-text-node",
textAlign: "left", textAlign: "left",
@ -16,7 +17,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, {
textHgap: 0, textHgap: 0,
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0,
}); });
}, },
@ -27,7 +28,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, {
element: this, element: this,
textAlign: o.textAlign, textAlign: o.textAlign,
whiteSpace: o.whiteSpace, whiteSpace: o.whiteSpace,
textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight, textHeight: o.whiteSpace === "nowrap" ? o.height : o.textHeight,
height: o.height, height: o.height,
hgap: o.textHgap, hgap: o.textHgap,
vgap: o.textVgap, vgap: o.textVgap,
@ -36,7 +37,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, {
text: o.text, text: o.text,
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
py: o.py py: o.py,
}); });
}, },
@ -71,7 +72,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, {
getText: function () { getText: function () {
return this.text.getText(); return this.text.getText();
} },
}); });
BI.TextNode.EVENT_CHANGE = "EVENT_CHANGE"; BI.TextNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_node", BI.TextNode); BI.shortcut("bi.text_node", BI.TextNode);

23
src/base/single/editor/editor.js

@ -38,7 +38,7 @@ BI.Editor = BI.inherit(BI.Single, {
watermark: o.watermark, watermark: o.watermark,
validationChecker: o.validationChecker, validationChecker: o.validationChecker,
quitChecker: o.quitChecker, quitChecker: o.quitChecker,
allowBlank: o.allowBlank allowBlank: o.allowBlank,
})); }));
this.editor.element.css({ this.editor.element.css({
width: "100%", width: "100%",
@ -46,7 +46,7 @@ BI.Editor = BI.inherit(BI.Single, {
border: "none", border: "none",
outline: "none", outline: "none",
padding: "0", padding: "0",
margin: "0" margin: "0",
}); });
var items = [{ var items = [{
@ -60,19 +60,19 @@ BI.Editor = BI.inherit(BI.Single, {
left: 0, left: 0,
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0,
}] }],
}, },
left: o.hgap + o.lgap, left: o.hgap + o.lgap,
right: o.hgap + o.rgap, right: o.hgap + o.rgap,
top: o.vgap + o.tgap, top: o.vgap + o.tgap,
bottom: o.vgap + o.bgap bottom: o.vgap + o.bgap,
}]; }];
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: items items: items,
}); });
this.setWaterMark(this.options.watermark); this.setWaterMark(this.options.watermark);
@ -159,6 +159,7 @@ BI.Editor = BI.inherit(BI.Single, {
}); });
this.element.click(function (e) { this.element.click(function (e) {
e.stopPropagation(); e.stopPropagation();
return false; return false;
}); });
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) { if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
@ -194,7 +195,7 @@ BI.Editor = BI.inherit(BI.Single, {
height: o.height - 2 * o.vgap - o.tgap, height: o.height - 2 * o.vgap - o.tgap,
hgap: 2, hgap: 2,
whiteSpace: "nowrap", whiteSpace: "nowrap",
textAlign: "left" textAlign: "left",
}); });
this.watermark.element.bind({ this.watermark.element.bind({
mousedown: function (e) { mousedown: function (e) {
@ -204,7 +205,7 @@ BI.Editor = BI.inherit(BI.Single, {
self.editor.isEditing() && self.editor.blur(); self.editor.isEditing() && self.editor.blur();
} }
e.stopEvent(); e.stopEvent();
} },
}); });
this.watermark.element.bind("click", function (e) { this.watermark.element.bind("click", function (e) {
if (self.isEnabled()) { if (self.isEnabled()) {
@ -240,7 +241,6 @@ BI.Editor = BI.inherit(BI.Single, {
}, },
setWaterMark: function (v) { setWaterMark: function (v) {
this.options.watermark = v; this.options.watermark = v;
if (BI.isNull(this.watermark)) { if (BI.isNull(this.watermark)) {
@ -269,7 +269,7 @@ BI.Editor = BI.inherit(BI.Single, {
} }
if (!this.disabledError && BI.isKey(errorText)) { if (!this.disabledError && BI.isKey(errorText)) {
BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {
adjustYOffset: o.simple ? 1 : 2 adjustYOffset: o.simple ? 1 : 2,
}); });
this._checkToolTip(); this._checkToolTip();
} }
@ -332,6 +332,7 @@ BI.Editor = BI.inherit(BI.Single, {
if (!this.isValid()) { if (!this.isValid()) {
return BI.trim(this.editor.getLastValidValue()); return BI.trim(this.editor.getLastValidValue());
} }
return BI.trim(this.editor.getValue()); return BI.trim(this.editor.getValue());
}, },
@ -345,7 +346,7 @@ BI.Editor = BI.inherit(BI.Single, {
destroyed: function () { destroyed: function () {
BI.Bubbles.remove(this.getName()); BI.Bubbles.remove(this.getName());
} },
}); });
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE"; BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";
BI.Editor.EVENT_FOCUS = "EVENT_FOCUS"; BI.Editor.EVENT_FOCUS = "EVENT_FOCUS";

11
src/base/single/editor/editor.multifile.js

@ -9,12 +9,13 @@
BI.MultifileEditor = BI.inherit(BI.Widget, { BI.MultifileEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.MultifileEditor.superclass._defaultConfig.apply(this, arguments); var conf = BI.MultifileEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-multifile-editor", baseCls: (conf.baseCls || "") + " bi-multifile-editor",
multiple: false, multiple: false,
maxSize: -1, // 1024 * 1024 maxSize: -1, // 1024 * 1024
accept: "", accept: "",
url: "" url: "",
}); });
}, },
@ -57,13 +58,13 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
el: { el: {
type: "bi.adaptive", type: "bi.adaptive",
scrollable: false, scrollable: false,
items: [this.file] items: [this.file],
}, },
top: 0, top: 0,
right: 0, right: 0,
left: 0, left: 0,
bottom: 0 bottom: 0,
}] }],
}); });
}, },
@ -104,7 +105,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
reset: function () { reset: function () {
this._reset(); this._reset();
} },
}); });
BI.MultifileEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultifileEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultifileEditor.EVENT_UPLOADSTART = "EVENT_UPLOADSTART"; BI.MultifileEditor.EVENT_UPLOADSTART = "EVENT_UPLOADSTART";

5
src/base/single/html/__test__/html.test.js

@ -5,14 +5,13 @@
*/ */
describe("HtmlTest", function () { describe("HtmlTest", function () {
/** /**
* test_author_windy * test_author_windy
*/ */
it("html_h1", function () { it("html_h1", function () {
var a = BI.Test.createWidget({ var a = BI.Test.createWidget({
type: "bi.html", type: "bi.html",
text: "<h1>在bi.html标签中使用html原生标签</h1>" text: "<h1>在bi.html标签中使用html原生标签</h1>",
}); });
expect(a.element.find("h1").length).to.equal(1); expect(a.element.find("h1").length).to.equal(1);
a.destroy(); a.destroy();
@ -32,7 +31,7 @@ describe("HtmlTest", function () {
highLight: true, highLight: true,
hgap: 10, hgap: 10,
vgap: 10, vgap: 10,
handler: BI.emptyFn handler: BI.emptyFn,
}); });
a.setValue("DDDDD"); a.setValue("DDDDD");
a.setStyle({ "background-color": "red" }); a.setStyle({ "background-color": "red" });

18
src/base/single/html/html.js

@ -25,22 +25,22 @@ BI.Html = BI.inherit(BI.Single, {
var self = this, o = this.options; var self = this, o = this.options;
if (o.hgap + o.lgap > 0) { if (o.hgap + o.lgap > 0) {
this.element.css({ this.element.css({
"padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit "padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit,
}); });
} }
if (o.hgap + o.rgap > 0) { if (o.hgap + o.rgap > 0) {
this.element.css({ this.element.css({
"padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit "padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit,
}); });
} }
if (o.vgap + o.tgap > 0) { if (o.vgap + o.tgap > 0) {
this.element.css({ this.element.css({
"padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit "padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit,
}); });
} }
if (o.vgap + o.bgap > 0) { if (o.vgap + o.bgap > 0) {
this.element.css({ this.element.css({
"padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit "padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit,
}); });
} }
if (BI.isNumber(o.height)) { if (BI.isNumber(o.height)) {
@ -55,13 +55,13 @@ BI.Html = BI.inherit(BI.Single, {
this.element.css({ this.element.css({
textAlign: o.textAlign, textAlign: o.textAlign,
whiteSpace: o.whiteSpace, whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === 'nowrap' ? "ellipsis" : "", textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto" overflow: o.whiteSpace === "nowrap" ? "" : "auto",
}); });
if (o.handler) { if (o.handler) {
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.layout", type: "bi.layout",
tagName: "span" tagName: "span",
}); });
this.text.element.click(function () { this.text.element.click(function () {
o.handler(self.getValue()); o.handler(self.getValue());
@ -69,7 +69,7 @@ BI.Html = BI.inherit(BI.Single, {
BI.createWidget({ BI.createWidget({
type: "bi.default", type: "bi.default",
element: this, element: this,
items: [this.text] items: [this.text],
}); });
} else { } else {
this.text = this; this.text = this;
@ -108,7 +108,7 @@ BI.Html = BI.inherit(BI.Single, {
BI.Html.superclass.setText.apply(this, arguments); BI.Html.superclass.setText.apply(this, arguments);
this.options.text = text; this.options.text = text;
this.text.element.html(text); this.text.element.html(text);
} },
}); });
BI.shortcut("bi.html", BI.Html); BI.shortcut("bi.html", BI.Html);

5
src/base/single/icon/icon.js

@ -6,9 +6,10 @@
BI.Icon = BI.inherit(BI.Single, { BI.Icon = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Icon.superclass._defaultConfig.apply(this, arguments); var conf = BI.Icon.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
tagName: "i", tagName: "i",
baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block" baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block",
}); });
}, },
@ -16,6 +17,6 @@ BI.Icon = BI.inherit(BI.Single, {
if (BI.isIE9Below && BI.isIE9Below()) { if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack"); this.element.addClass("hack");
} }
} },
}); });
BI.shortcut("bi.icon", BI.Icon); BI.shortcut("bi.icon", BI.Icon);

3
src/base/single/iframe/__test__/iframe.test.js

@ -5,13 +5,12 @@
*/ */
describe("IframeTest", function () { describe("IframeTest", function () {
/** /**
* test_author_windy * test_author_windy
*/ */
it("directionPager", function () { it("directionPager", function () {
var a = BI.Test.createWidget({ var a = BI.Test.createWidget({
type: "bi.iframe" type: "bi.iframe",
}); });
a.setSrc("http://www.baidu.com"); a.setSrc("http://www.baidu.com");
a.setName("testIFrame"); a.setName("testIFrame");

7
src/base/single/iframe/iframe.js

@ -7,6 +7,7 @@
BI.Iframe = BI.inherit(BI.Single, { BI.Iframe = BI.inherit(BI.Single, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
var conf = BI.Iframe.superclass._defaultConfig.apply(this, arguments); var conf = BI.Iframe.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
tagName: "iframe", tagName: "iframe",
baseCls: (conf.baseCls || "") + " bi-iframe", baseCls: (conf.baseCls || "") + " bi-iframe",
@ -14,7 +15,7 @@ BI.Iframe = BI.inherit(BI.Single, {
name: "", name: "",
attributes: {}, attributes: {},
width: "100%", width: "100%",
height: "100%" height: "100%",
}); });
}, },
@ -31,7 +32,7 @@ BI.Iframe = BI.inherit(BI.Single, {
this.options.attributes = BI.extend({ this.options.attributes = BI.extend({
frameborder: 0, frameborder: 0,
src: o.src, src: o.src,
name: o.name name: o.name,
}, this.options.attributes); }, this.options.attributes);
}, },
@ -51,7 +52,7 @@ BI.Iframe = BI.inherit(BI.Single, {
getName: function () { getName: function () {
return this.options.name; return this.options.name;
} },
}); });
BI.shortcut("bi.iframe", BI.Iframe); BI.shortcut("bi.iframe", BI.Iframe);

3
src/base/single/img/__test__/img.test.js

@ -5,7 +5,6 @@
*/ */
describe("ImgTest", function () { describe("ImgTest", function () {
/** /**
* test_author_windy * test_author_windy
*/ */
@ -13,7 +12,7 @@ describe("ImgTest", function () {
var a = BI.Test.createWidget({ var a = BI.Test.createWidget({
type: "bi.img", type: "bi.img",
iconWidth: 36, iconWidth: 36,
iconHeight: 36 iconHeight: 36,
}); });
a.setSrc("test.png"); a.setSrc("test.png");
expect(a.element.attr("src")).to.equal("test.png"); expect(a.element.attr("src")).to.equal("test.png");

7
src/base/single/img/img.js

@ -9,13 +9,14 @@
BI.Img = BI.inherit(BI.Single, { BI.Img = BI.inherit(BI.Single, {
_defaultConfig: function (config) { _defaultConfig: function (config) {
var conf = BI.Img.superclass._defaultConfig.apply(this, arguments); var conf = BI.Img.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
tagName: "img", tagName: "img",
baseCls: (conf.baseCls || "") + " bi-img display-block", baseCls: (conf.baseCls || "") + " bi-img display-block",
src: "", src: "",
attributes: config.src ? { src: config.src } : {}, attributes: config.src ? { src: config.src } : {},
width: "100%", width: "100%",
height: "100%" height: "100%",
}); });
}, },
@ -23,7 +24,7 @@ BI.Img = BI.inherit(BI.Single, {
BI.Img.superclass._initProps.apply(this, arguments); BI.Img.superclass._initProps.apply(this, arguments);
var o = this.options; var o = this.options;
this.options.attributes = BI.extend({ this.options.attributes = BI.extend({
src: o.src src: o.src,
}, this.options.attributes); }, this.options.attributes);
}, },
@ -34,7 +35,7 @@ BI.Img = BI.inherit(BI.Single, {
getSrc: function () { getSrc: function () {
return this.options.src; return this.options.src;
} },
}); });
BI.shortcut("bi.img", BI.Img); BI.shortcut("bi.img", BI.Img);

5
src/base/single/input/checkbox/checkbox.image.js

@ -6,6 +6,7 @@
BI.ImageCheckbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
@ -13,9 +14,9 @@ BI.ImageCheckbox = BI.inherit(BI.IconButton, {
width: 16, width: 16,
height: 16, height: 16,
iconWidth: 16, iconWidth: 16,
iconHeight: 16 iconHeight: 16,
}); });
} },
}); });
BI.ImageCheckbox.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE; BI.ImageCheckbox.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE;

9
src/base/single/input/checkbox/checkbox.js

@ -12,11 +12,12 @@ BI.Checkbox = BI.inherit(BI.BasicButton, {
width: 14, width: 14,
height: 14, height: 14,
iconWidth: 14, iconWidth: 14,
iconHeight: 14 iconHeight: 14,
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.center_adapt", type: "bi.center_adapt",
items: [{ items: [{
@ -26,8 +27,8 @@ BI.Checkbox = BI.inherit(BI.BasicButton, {
}, },
cls: "checkbox-content", cls: "checkbox-content",
width: o.iconWidth, width: o.iconWidth,
height: o.iconHeight height: o.iconHeight,
}] }],
}; };
}, },
@ -54,7 +55,7 @@ BI.Checkbox = BI.inherit(BI.BasicButton, {
} else { } else {
this.checkbox.element.removeClass("bi-high-light-background"); this.checkbox.element.removeClass("bi-high-light-background");
} }
} },
}); });
BI.Checkbox.EVENT_CHANGE = "EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "EVENT_CHANGE";

35
src/base/single/input/input.js

@ -7,12 +7,13 @@
BI.Input = BI.inherit(BI.Single, { BI.Input = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Input.superclass._defaultConfig.apply(this, arguments); var conf = BI.Input.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-input display-block overflow-dot", baseCls: (conf.baseCls || "") + " bi-input display-block overflow-dot",
tagName: "input", tagName: "input",
validationChecker: BI.emptyFn, validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn, // 按确定键能否退出编辑 quitChecker: BI.emptyFn, // 按确定键能否退出编辑
allowBlank: false allowBlank: false,
}); });
}, },
@ -27,15 +28,15 @@ BI.Input = BI.inherit(BI.Single, {
}, BI.EVENT_RESPONSE_TIME); }, BI.EVENT_RESPONSE_TIME);
var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, { var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, {
"leading": true, "leading": true,
"trailing": false "trailing": false,
}); });
this._focusDebounce = BI.debounce(BI.bind(this._focus, this), BI.EVENT_RESPONSE_TIME, { this._focusDebounce = BI.debounce(BI.bind(this._focus, this), BI.EVENT_RESPONSE_TIME, {
"leading": true, "leading": true,
"trailing": false "trailing": false,
}); });
this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, { this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, {
"leading": true, "leading": true,
"trailing": false "trailing": false,
}); });
this.element this.element
.keydown(function (e) { .keydown(function (e) {
@ -86,7 +87,7 @@ BI.Input = BI.inherit(BI.Single, {
this.element.addClass("bi-input-focus"); this.element.addClass("bi-input-focus");
this._checkValidationOnValueChange(); this._checkValidationOnValueChange();
this._isEditing = true; this._isEditing = true;
if (this.getValue() == "") { if (this.getValue() === "") {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_EMPTY); this.fireEvent(BI.Input.EVENT_EMPTY);
} }
@ -139,7 +140,7 @@ BI.Input = BI.inherit(BI.Single, {
this._checkValidationOnValueChange(); this._checkValidationOnValueChange();
} }
if (this.isValid() && BI.trim(this.getValue()) !== "") { if (this.isValid() && BI.trim(this.getValue()) !== "") {
if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || this._lastValue == null || this._lastValue === "") if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || BI.isNull(this._lastValue) || this._lastValue === "")
|| (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) { || (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) {
this._start = true; this._start = true;
this._pause = false; this._pause = false;
@ -147,7 +148,7 @@ BI.Input = BI.inherit(BI.Single, {
this.fireEvent(BI.Input.EVENT_START); this.fireEvent(BI.Input.EVENT_START);
} }
} }
if (keyCode == BI.KeyCode.ENTER) { if (BI.isEqual(keyCode, BI.KeyCode.ENTER)) {
if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) { if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) {
this.blur(); this.blur();
this.fireEvent(BI.Input.EVENT_ENTER); this.fireEvent(BI.Input.EVENT_ENTER);
@ -155,13 +156,13 @@ BI.Input = BI.inherit(BI.Single, {
this.fireEvent(BI.Input.EVENT_RESTRICT); this.fireEvent(BI.Input.EVENT_RESTRICT);
} }
} }
if (keyCode == BI.KeyCode.SPACE) { if (BI.isEqual(keyCode, BI.KeyCode.SPACE)) {
this.fireEvent(BI.Input.EVENT_SPACE); this.fireEvent(BI.Input.EVENT_SPACE);
} }
if (keyCode == BI.KeyCode.BACKSPACE && this._lastValue == "") { if (BI.isEqual(keyCode, BI.KeyCode.BACKSPACE) && this._lastValue === "") {
this.fireEvent(BI.Input.EVENT_REMOVE); this.fireEvent(BI.Input.EVENT_REMOVE);
} }
if (keyCode == BI.KeyCode.BACKSPACE || keyCode == BI.KeyCode.DELETE) { if (BI.isEqual(keyCode, BI.KeyCode.BACKSPACE) || BI.isEqual(keyCode, BI.KeyCode.DELETE)) {
this.fireEvent(BI.Input.EVENT_BACKSPACE); this.fireEvent(BI.Input.EVENT_BACKSPACE);
} }
this.fireEvent(BI.Input.EVENT_KEY_DOWN, arguments); this.fireEvent(BI.Input.EVENT_KEY_DOWN, arguments);
@ -185,7 +186,7 @@ BI.Input = BI.inherit(BI.Single, {
// 初始状态 // 初始状态
_defaultState: function () { _defaultState: function () {
if (this.getValue() == "") { if (this.getValue() === "") {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_EMPTY); this.fireEvent(BI.Input.EVENT_EMPTY);
} }
@ -199,7 +200,7 @@ BI.Input = BI.inherit(BI.Single, {
this.fireEvent(BI.Input.EVENT_CHANGE); this.fireEvent(BI.Input.EVENT_CHANGE);
this._lastSubmitValue = BI.trim(this.getValue()); this._lastSubmitValue = BI.trim(this.getValue());
} }
if (this.getValue() == "") { if (this.getValue() === "") {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this); this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_EMPTY); this.fireEvent(BI.Input.EVENT_EMPTY);
} }
@ -209,14 +210,16 @@ BI.Input = BI.inherit(BI.Single, {
_checkValidationOnValueChange: function (callback) { _checkValidationOnValueChange: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
var v = this.getValue(); var v = this.getValue();
if (o.allowBlank === true && BI.trim(v) == "") { if (o.allowBlank === true && BI.trim(v) === "") {
this.setValid(true); this.setValid(true);
callback && callback(); callback && callback();
return; return;
} }
if (BI.trim(v) == "") { if (BI.trim(v) === "") {
this.setValid(false); this.setValid(false);
callback && callback(); callback && callback();
return; return;
} }
var checker = o.validationChecker.apply(this, [BI.trim(v)]); var checker = o.validationChecker.apply(this, [BI.trim(v)]);
@ -224,7 +227,7 @@ BI.Input = BI.inherit(BI.Single, {
checker.then(function (validate) { checker.then(function (validate) {
self.setValid(validate !== false); self.setValid(validate !== false);
callback && callback(); callback && callback();
}) });
} else { } else {
this.setValid(checker !== false); this.setValid(checker !== false);
callback && callback(); callback && callback();
@ -306,7 +309,7 @@ BI.Input = BI.inherit(BI.Single, {
_setEnable: function (b) { _setEnable: function (b) {
BI.Input.superclass._setEnable.apply(this, [b]); BI.Input.superclass._setEnable.apply(this, [b]);
this.element[0].disabled = !b; this.element[0].disabled = !b;
} },
}); });
BI.Input.EVENT_CHANGE = "EVENT_CHANGE"; BI.Input.EVENT_CHANGE = "EVENT_CHANGE";

5
src/base/single/input/radio/radio.image.js

@ -6,6 +6,7 @@
BI.ImageRadio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -13,7 +14,7 @@ BI.ImageRadio = BI.inherit(BI.IconButton, {
width: 16, width: 16,
height: 16, height: 16,
iconWidth: 16, iconWidth: 16,
iconHeight: 16 iconHeight: 16,
}); });
}, },
@ -22,7 +23,7 @@ BI.ImageRadio = BI.inherit(BI.IconButton, {
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE); this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
} }
} },
}); });
BI.ImageRadio.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE; BI.ImageRadio.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE;

9
src/base/single/input/radio/radio.js

@ -12,11 +12,12 @@ BI.Radio = BI.inherit(BI.BasicButton, {
width: 14, width: 14,
height: 14, height: 14,
iconWidth: 14, iconWidth: 14,
iconHeight: 14 iconHeight: 14,
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.center_adapt", type: "bi.center_adapt",
items: [{ items: [{
@ -26,8 +27,8 @@ BI.Radio = BI.inherit(BI.BasicButton, {
self.radio = _ref; self.radio = _ref;
}, },
width: o.iconWidth, width: o.iconWidth,
height: o.iconHeight height: o.iconHeight,
}] }],
}; };
}, },
@ -54,7 +55,7 @@ BI.Radio = BI.inherit(BI.BasicButton, {
} else { } else {
this.radio.element.removeClass("bi-high-light-background"); this.radio.element.removeClass("bi-high-light-background");
} }
} },
}); });
BI.Radio.EVENT_CHANGE = "EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "EVENT_CHANGE";

2
src/base/single/tip/0.tip.js

@ -18,6 +18,6 @@ BI.Tip = BI.inherit(BI.Single, {
_init: function () { _init: function () {
BI.Tip.superclass._init.apply(this, arguments); BI.Tip.superclass._init.apply(this, arguments);
this.element.css({ zIndex: this.options.zIndex, }); this.element.css({ zIndex: this.options.zIndex });
}, },
}); });

2
src/base/tree/customtree.js

@ -47,7 +47,7 @@ BI.CustomTree = BI.inherit(BI.Widget, {
el: { el: {
value: node.value, value: node.value,
}, },
popup: { type: "bi.custom_tree", }, popup: { type: "bi.custom_tree" },
}, BI.deepClone(o.expander), { }, BI.deepClone(o.expander), {
id: node.id, id: node.id,
pId: node.pId, pId: node.pId,

Loading…
Cancel
Save