From 2f6807b0fb53e387df852e40f3393ea88e828d37 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 16 Jul 2018 16:18:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BBBubble=E4=B8=AD=E7=9A=84=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E5=80=BC=20&&=20=E5=8E=BBaction=20&&=20=E5=8E=BBset?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84get=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/base.js | 4 +- dist/bundle.js | 59 +++++++++++-------- dist/case.js | 9 +-- dist/core.js | 15 ++--- dist/fineui.js | 59 +++++++++++-------- dist/widget.js | 31 ++++++---- src/base/single/editor/editor.js | 4 +- .../colorpicker/editor.colorpicker.js | 6 +- .../icontextvaluecombo/combo.icontextvalue.js | 1 - .../combo.searchtextvalue.js | 1 - .../combo/textvaluecombo/combo.textvalue.js | 1 - .../combo.treevaluechooser.js | 1 - src/core/controller/controller.bubbles.js | 15 ++--- src/widget/numberinterval/numberinterval.js | 30 ++++++---- 14 files changed, 144 insertions(+), 92 deletions(-) diff --git a/dist/base.js b/dist/base.js index 612ec3baa..50beebc49 100644 --- a/dist/base.js +++ b/dist/base.js @@ -18567,7 +18567,9 @@ BI.Editor = BI.inherit(BI.Single, { errorText = errorText(this.editor.getValue()); } if (!this.disabledError && BI.isKey(errorText)) { - BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this); + BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { + adjustLength: 2 + }); this._checkToolTip(); return BI.Bubbles.get(this.getName()); } diff --git a/dist/bundle.js b/dist/bundle.js index b995e0d48..dd2ddfb4a 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -26766,6 +26766,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { var container = opt.container || context; var offsetStyle = opt.offsetStyle || {}; var level = opt.level || "error"; + var adjustLength = opt.adjustLength || 0; if (!this.storeBubbles[name]) { this.storeBubbles[name] = {}; } @@ -26781,9 +26782,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["top"]); var position = this._getTopPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top - 2}); + this.get(name).element.css({left: position.left, top: position.top - adjustLength}); this.get(name).invisible(); - if (!$.isTopSpaceEnough(context, this.get(name), 2)) { + if (!$.isTopSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["left"]) { this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30); } @@ -26796,9 +26797,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["left"]); var position = this._getLeftPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left - 2, top: position.top}); + this.get(name).element.css({left: position.left - adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isLeftSpaceEnough(context, this.get(name), 2)) { + if (!$.isLeftSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["right"]) { this.storeBubbles[name]["right"] = this._createBubble("right", text, level, 30); } @@ -26811,9 +26812,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["right"]); var position = this._getRightPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + 2, top: position.top}); + this.get(name).element.css({left: position.left + adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isRightSpaceEnough(context, this.get(name), 2)) { + if (!$.isRightSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["bottom"]) { this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level); } @@ -26826,7 +26827,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["bottom"]); var position = this._getBottomPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top + 2}); + this.get(name).element.css({left: position.left, top: position.top + adjustLength}); this.get(name).invisible(); } } @@ -54372,7 +54373,9 @@ BI.Editor = BI.inherit(BI.Single, { errorText = errorText(this.editor.getValue()); } if (!this.disabledError && BI.isKey(errorText)) { - BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this); + BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { + adjustLength: 2 + }); this._checkToolTip(); return BI.Bubbles.get(this.getName()); } @@ -77203,7 +77206,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { _setEnable: function () { BI.ColorPickerEditor.superclass._setEnable.apply(this, arguments); - this._showPreColor(this.getValue()); + this._showPreColor(this._isEmptyRGB() && this.transparent.isSelected() ? "transparent" : BI.DOM.rgb2hex(BI.DOM.json2rgb({ + r: this.storeValue.r, + g: this.storeValue.g, + b: this.storeValue.b + }))); }, setValue: function (color) { @@ -78500,7 +78507,6 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, @@ -78666,7 +78672,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { ref: function () { self.trigger = this; }, - action: o.action, items: o.items, height: o.height - 2, text: o.text, @@ -79256,7 +79261,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, @@ -102140,7 +102144,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { border: 1, less: 0, less_equal: 1, - numTip: "" + numTip: "", + adjustLength: 2 }, _defaultConfig: function () { var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments); @@ -102426,17 +102431,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -102472,7 +102480,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { w.on(BI.Editor.EVENT_ERROR, function () { self._checkValidation(); BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); }); @@ -102485,13 +102494,15 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; @@ -102508,17 +102519,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -113055,7 +113069,6 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { } this.combo = BI.createWidget({ type: "bi.multi_tree_combo", - trigger: o.trigger, element: this, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), diff --git a/dist/case.js b/dist/case.js index 652f66972..8a3ad79f6 100644 --- a/dist/case.js +++ b/dist/case.js @@ -4638,7 +4638,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { _setEnable: function () { BI.ColorPickerEditor.superclass._setEnable.apply(this, arguments); - this._showPreColor(this.getValue()); + this._showPreColor(this._isEmptyRGB() && this.transparent.isSelected() ? "transparent" : BI.DOM.rgb2hex(BI.DOM.json2rgb({ + r: this.storeValue.r, + g: this.storeValue.g, + b: this.storeValue.b + }))); }, setValue: function (color) { @@ -5935,7 +5939,6 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, @@ -6101,7 +6104,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { ref: function () { self.trigger = this; }, - action: o.action, items: o.items, height: o.height - 2, text: o.text, @@ -6691,7 +6693,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, diff --git a/dist/core.js b/dist/core.js index fc0ffd708..ad5c3bd2a 100644 --- a/dist/core.js +++ b/dist/core.js @@ -26766,6 +26766,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { var container = opt.container || context; var offsetStyle = opt.offsetStyle || {}; var level = opt.level || "error"; + var adjustLength = opt.adjustLength || 0; if (!this.storeBubbles[name]) { this.storeBubbles[name] = {}; } @@ -26781,9 +26782,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["top"]); var position = this._getTopPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top - 2}); + this.get(name).element.css({left: position.left, top: position.top - adjustLength}); this.get(name).invisible(); - if (!$.isTopSpaceEnough(context, this.get(name), 2)) { + if (!$.isTopSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["left"]) { this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30); } @@ -26796,9 +26797,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["left"]); var position = this._getLeftPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left - 2, top: position.top}); + this.get(name).element.css({left: position.left - adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isLeftSpaceEnough(context, this.get(name), 2)) { + if (!$.isLeftSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["right"]) { this.storeBubbles[name]["right"] = this._createBubble("right", text, level, 30); } @@ -26811,9 +26812,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["right"]); var position = this._getRightPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + 2, top: position.top}); + this.get(name).element.css({left: position.left + adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isRightSpaceEnough(context, this.get(name), 2)) { + if (!$.isRightSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["bottom"]) { this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level); } @@ -26826,7 +26827,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["bottom"]); var position = this._getBottomPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top + 2}); + this.get(name).element.css({left: position.left, top: position.top + adjustLength}); this.get(name).invisible(); } } diff --git a/dist/fineui.js b/dist/fineui.js index 33d7748c1..a2e260db8 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -27015,6 +27015,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { var container = opt.container || context; var offsetStyle = opt.offsetStyle || {}; var level = opt.level || "error"; + var adjustLength = opt.adjustLength || 0; if (!this.storeBubbles[name]) { this.storeBubbles[name] = {}; } @@ -27030,9 +27031,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["top"]); var position = this._getTopPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top - 2}); + this.get(name).element.css({left: position.left, top: position.top - adjustLength}); this.get(name).invisible(); - if (!$.isTopSpaceEnough(context, this.get(name), 2)) { + if (!$.isTopSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["left"]) { this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30); } @@ -27045,9 +27046,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["left"]); var position = this._getLeftPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left - 2, top: position.top}); + this.get(name).element.css({left: position.left - adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isLeftSpaceEnough(context, this.get(name), 2)) { + if (!$.isLeftSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["right"]) { this.storeBubbles[name]["right"] = this._createBubble("right", text, level, 30); } @@ -27060,9 +27061,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["right"]); var position = this._getRightPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + 2, top: position.top}); + this.get(name).element.css({left: position.left + adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isRightSpaceEnough(context, this.get(name), 2)) { + if (!$.isRightSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["bottom"]) { this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level); } @@ -27075,7 +27076,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["bottom"]); var position = this._getBottomPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top + 2}); + this.get(name).element.css({left: position.left, top: position.top + adjustLength}); this.get(name).invisible(); } } @@ -54621,7 +54622,9 @@ BI.Editor = BI.inherit(BI.Single, { errorText = errorText(this.editor.getValue()); } if (!this.disabledError && BI.isKey(errorText)) { - BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this); + BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { + adjustLength: 2 + }); this._checkToolTip(); return BI.Bubbles.get(this.getName()); } @@ -77452,7 +77455,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { _setEnable: function () { BI.ColorPickerEditor.superclass._setEnable.apply(this, arguments); - this._showPreColor(this.getValue()); + this._showPreColor(this._isEmptyRGB() && this.transparent.isSelected() ? "transparent" : BI.DOM.rgb2hex(BI.DOM.json2rgb({ + r: this.storeValue.r, + g: this.storeValue.g, + b: this.storeValue.b + }))); }, setValue: function (color) { @@ -78749,7 +78756,6 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, @@ -78915,7 +78921,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { ref: function () { self.trigger = this; }, - action: o.action, items: o.items, height: o.height - 2, text: o.text, @@ -79505,7 +79510,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, @@ -102389,7 +102393,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { border: 1, less: 0, less_equal: 1, - numTip: "" + numTip: "", + adjustLength: 2 }, _defaultConfig: function () { var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments); @@ -102675,17 +102680,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -102721,7 +102729,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { w.on(BI.Editor.EVENT_ERROR, function () { self._checkValidation(); BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); }); @@ -102734,13 +102743,15 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; @@ -102757,17 +102768,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -113304,7 +113318,6 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { } this.combo = BI.createWidget({ type: "bi.multi_tree_combo", - trigger: o.trigger, element: this, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), diff --git a/dist/widget.js b/dist/widget.js index 4492053df..2cc544e9c 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -14334,7 +14334,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { border: 1, less: 0, less_equal: 1, - numTip: "" + numTip: "", + adjustLength: 2 }, _defaultConfig: function () { var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments); @@ -14620,17 +14621,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -14666,7 +14670,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { w.on(BI.Editor.EVENT_ERROR, function () { self._checkValidation(); BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); }); @@ -14679,13 +14684,15 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; @@ -14702,17 +14709,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -25249,7 +25259,6 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { } this.combo = BI.createWidget({ type: "bi.multi_tree_combo", - trigger: o.trigger, element: this, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), diff --git a/src/base/single/editor/editor.js b/src/base/single/editor/editor.js index a2ac09fd1..60014a3eb 100644 --- a/src/base/single/editor/editor.js +++ b/src/base/single/editor/editor.js @@ -226,7 +226,9 @@ BI.Editor = BI.inherit(BI.Single, { errorText = errorText(this.editor.getValue()); } if (!this.disabledError && BI.isKey(errorText)) { - BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this); + BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { + adjustLength: 2 + }); this._checkToolTip(); return BI.Bubbles.get(this.getName()); } diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.js b/src/case/colorchooser/colorpicker/editor.colorpicker.js index 284167003..be9a33834 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.js @@ -192,7 +192,11 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { _setEnable: function () { BI.ColorPickerEditor.superclass._setEnable.apply(this, arguments); - this._showPreColor(this.getValue()); + this._showPreColor(this._isEmptyRGB() && this.transparent.isSelected() ? "transparent" : BI.DOM.rgb2hex(BI.DOM.json2rgb({ + r: this.storeValue.r, + g: this.storeValue.g, + b: this.storeValue.b + }))); }, setValue: function (color) { diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index 112505c4e..068d3394f 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -18,7 +18,6 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index 8a33ec809..cada57d89 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -29,7 +29,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { ref: function () { self.trigger = this; }, - action: o.action, items: o.items, height: o.height - 2, text: o.text, diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 806b17406..a34edbac8 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -20,7 +20,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; this.trigger = BI.createWidget({ type: "bi.select_text_trigger", - action: o.action, items: o.items, height: o.height, text: o.text, diff --git a/src/component/treevaluechooser/combo.treevaluechooser.js b/src/component/treevaluechooser/combo.treevaluechooser.js index 0469d1155..88462ac95 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.js @@ -25,7 +25,6 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { } this.combo = BI.createWidget({ type: "bi.multi_tree_combo", - trigger: o.trigger, element: this, itemsCreator: BI.bind(this._itemsCreator, this), valueFormatter: BI.bind(this._valueFormatter, this), diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index a482860b4..247acb289 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -112,6 +112,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { var container = opt.container || context; var offsetStyle = opt.offsetStyle || {}; var level = opt.level || "error"; + var adjustLength = opt.adjustLength || 0; if (!this.storeBubbles[name]) { this.storeBubbles[name] = {}; } @@ -127,9 +128,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["top"]); var position = this._getTopPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top - 2}); + this.get(name).element.css({left: position.left, top: position.top - adjustLength}); this.get(name).invisible(); - if (!$.isTopSpaceEnough(context, this.get(name), 2)) { + if (!$.isTopSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["left"]) { this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30); } @@ -142,9 +143,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["left"]); var position = this._getLeftPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left - 2, top: position.top}); + this.get(name).element.css({left: position.left - adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isLeftSpaceEnough(context, this.get(name), 2)) { + if (!$.isLeftSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["right"]) { this.storeBubbles[name]["right"] = this._createBubble("right", text, level, 30); } @@ -157,9 +158,9 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["right"]); var position = this._getRightPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left + 2, top: position.top}); + this.get(name).element.css({left: position.left + adjustLength, top: position.top}); this.get(name).invisible(); - if (!$.isRightSpaceEnough(context, this.get(name), 2)) { + if (!$.isRightSpaceEnough(context, this.get(name), adjustLength)) { if (!this.storeBubbles[name]["bottom"]) { this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level); } @@ -172,7 +173,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { }); this.set(name, this.storeBubbles[name]["bottom"]); var position = this._getBottomPosition(name, context, offsetStyle); - this.get(name).element.css({left: position.left, top: position.top + 2}); + this.get(name).element.css({left: position.left, top: position.top + adjustLength}); this.get(name).invisible(); } } diff --git a/src/widget/numberinterval/numberinterval.js b/src/widget/numberinterval/numberinterval.js index 66097533a..5d8bc287d 100644 --- a/src/widget/numberinterval/numberinterval.js +++ b/src/widget/numberinterval/numberinterval.js @@ -17,7 +17,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { border: 1, less: 0, less_equal: 1, - numTip: "" + numTip: "", + adjustLength: 2 }, _defaultConfig: function () { var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments); @@ -303,17 +304,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default : @@ -349,7 +353,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { w.on(BI.Editor.EVENT_ERROR, function () { self._checkValidation(); BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); }); @@ -362,13 +367,15 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); self.fireEvent(BI.NumberInterval.EVENT_ERROR); break; @@ -385,17 +392,20 @@ BI.NumberInterval = BI.inherit(BI.Single, { switch (self._checkValidation()) { case c.typeError: BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.numberError: BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; case c.signalError: BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, { - offsetStyle: "left" + offsetStyle: "left", + adjustLength: c.adjustLength }); break; default :