diff --git a/src/case/editor/editor.state.js b/src/case/editor/editor.state.js index 1de0de2624..7514e6ad9a 100644 --- a/src/case/editor/editor.state.js +++ b/src/case/editor/editor.state.js @@ -46,7 +46,7 @@ BI.StateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text tip-text-style", + cls: "bi-water-mark tip-text-style", textAlign: "left", height: o.height, text: o.text, @@ -243,31 +243,31 @@ BI.StateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Select_All")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (BI.isString(v)) { this.text.setText(v); - this.text.element.removeClass("state-editor-infinite-text"); + v === o.text ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark"); return; } if (BI.isArray(v)) { if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else if (v.length === 1) { this.text.setText(v[0]); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Select_Part")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }, diff --git a/src/case/editor/editor.state.simple.js b/src/case/editor/editor.state.simple.js index 449e5e8bc6..c95b160a0b 100644 --- a/src/case/editor/editor.state.simple.js +++ b/src/case/editor/editor.state.simple.js @@ -47,7 +47,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { }); this.text = BI.createWidget({ type: "bi.text_button", - cls: "state-editor-infinite-text", + cls: "bi-water-mark", textAlign: "left", text: o.text, height: o.height, @@ -229,26 +229,26 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, { if (BI.isNumber(v)) { if (v === BI.Selection.All) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (v === BI.Selection.Multi) { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } return; } if (!BI.isArray(v) || v.length === 1) { this.text.setText(v); this.text.setTitle(v); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } else if (BI.isEmpty(v)) { this.text.setText(o.text); - this.text.element.addClass("state-editor-infinite-text"); + this.text.element.addClass("bi-water-mark"); } else { this.text.setText(BI.i18nText("BI-Already_Selected")); - this.text.element.removeClass("state-editor-infinite-text"); + this.text.element.removeClass("bi-water-mark"); } } }); diff --git a/src/case/trigger/trigger.icon.text.js b/src/case/trigger/trigger.icon.text.js index c4ea4c27d5..35005606c8 100644 --- a/src/case/trigger/trigger.icon.text.js +++ b/src/case/trigger/trigger.icon.text.js @@ -16,7 +16,8 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, iconHeight: null, - iconWidth: null + iconWidth: null, + textCls: "" }); }, @@ -25,7 +26,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text @@ -90,6 +91,11 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { } }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + }, + setText: function (text) { this.text.setText(text); } diff --git a/src/case/trigger/trigger.icon.text.select.js b/src/case/trigger/trigger.icon.text.select.js index 75d909ce52..752cde1c7f 100644 --- a/src/case/trigger/trigger.icon.text.select.js +++ b/src/case/trigger/trigger.icon.text.select.js @@ -22,6 +22,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { type: "bi.icon_text_trigger", element: this, text: obj.text, + textCls: obj.textCls, iconCls: obj.iconCls, height: o.height, iconHeight: o.iconHeight, @@ -48,11 +49,13 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { if (BI.isNotNull(result)) { return { text: result.text, + textCls: "", iconCls: result.iconCls }; } else { return { text: o.text, + textCls: "bi-water-mark", iconCls: o.iconCls }; } @@ -62,6 +65,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { var obj = this._digist(vals, this.options.items); this.trigger.setText(obj.text); this.trigger.setIcon(obj.iconCls); + this.trigger.setTextCls(obj.textCls); }, populate: function (items) { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index 80bce8ec3a..80674c8152 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -14,7 +14,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 24 + height: 24, + textCls: "" }); }, @@ -23,7 +24,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", - cls: "select-text-label", + cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, text: o.text, @@ -54,6 +55,11 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }); }, + setTextCls: function(cls) { + var o = this.options; + this.text.element.removeClass(o.textCls).addClass(cls); + }, + setText: function (text) { this.text.setText(text); }, diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index a5eae5e932..4c6b519433 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -18,12 +18,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { this.options.height -= 2; BI.SelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; + var obj = this._digest(o.text, o.items); this.trigger = BI.createWidget({ type: "bi.text_trigger", element: this, height: o.height, readonly: o.readonly, - text: this._digest(o.value, o.items), + text: obj.text, + textCls: obj.textCls, tipType: o.tipType, warningTitle: o.warningTitle }); @@ -41,14 +43,22 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { }); if (result.length > 0) { - return result.join(","); + return { + textCls: "", + text: result.join(",") + } } else { - return BI.isFunction(o.text) ? o.text() : o.text; + return { + textCls: "bi-water-mark", + text: BI.isFunction(o.text) ? o.text() : o.text + } } }, setValue: function (vals) { - this.trigger.setText(this._digest(vals, this.options.items)); + var formatValue = this._digest(vals, this.options.items); + this.trigger.setTextCls(formatValue.textCls); + this.trigger.setText(formatValue.text); }, setTipType: function (v) {