From c7fc741dea587fda41180185f3bbce07a655664c Mon Sep 17 00:00:00 2001 From: fay Date: Thu, 19 Apr 2018 19:16:13 +0800 Subject: [PATCH] update --- src/widget/month/trigger.month.js | 5 ++--- src/widget/year/trigger.year.js | 8 +++----- src/widget/yearmonth/trigger.yearmonth.js | 6 ++---- src/widget/yearquarter/trigger.yearquarter.js | 6 ++---- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/widget/month/trigger.month.js b/src/widget/month/trigger.month.js index 4176fcb453..4fa800603a 100644 --- a/src/widget/month/trigger.month.js +++ b/src/widget/month/trigger.month.js @@ -8,8 +8,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2, - errorText: BI.i18nText("BI-Month_Trigger_Error_Text") + vgap: 2 }, _defaultConfig: function () { @@ -33,7 +32,7 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, { hgap: c.hgap, vgap: c.vgap, allowBlank: true, - errorText: c.errorText + errorText: BI.i18nText("BI-Month_Trigger_Error_Text") }); this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { self.fireEvent(BI.MonthTrigger.EVENT_FOCUS); diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index 28a50a4211..d1ab38b62c 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -1,9 +1,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2, - errorText: BI.i18nText("BI-Please_Input_Positive_Integer"), - errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text") + vgap: 2 }, _defaultConfig: function () { @@ -31,7 +29,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { watermark: BI.i18nText("BI-Basic_Unrestricted"), allowBlank: true, errorText: function (v) { - return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid; + return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); } }); this.editor.on(BI.SignEditor.EVENT_FOCUS, function () { @@ -105,7 +103,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { this.editor.setValue(dateStr); this.setTitle(BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr)); }, - + setValue: function (v) { var type, value; var date = BI.getDate(); diff --git a/src/widget/yearmonth/trigger.yearmonth.js b/src/widget/yearmonth/trigger.yearmonth.js index e943d0164c..b8133a2bb6 100644 --- a/src/widget/yearmonth/trigger.yearmonth.js +++ b/src/widget/yearmonth/trigger.yearmonth.js @@ -1,9 +1,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2, - errorText: BI.i18nText("BI-Please_Input_Positive_Integer"), - errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text") + vgap: 2 }, props: { @@ -72,7 +70,7 @@ BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, { }, watermark: BI.i18nText("BI-Basic_Unrestricted"), errorText: function (v) { - return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid; + return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, hgap: c.hgap, vgap: c.vgap, diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/src/widget/yearquarter/trigger.yearquarter.js index 017c56df64..d81fca7d7e 100644 --- a/src/widget/yearquarter/trigger.yearquarter.js +++ b/src/widget/yearquarter/trigger.yearquarter.js @@ -1,9 +1,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4, - vgap: 2, - errorText: BI.i18nText("BI-Please_Input_Positive_Integer"), - errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text") + vgap: 2 }, props: { @@ -71,7 +69,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { return false; }, errorText: function (v) { - return !BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid; + return !BI.isPositiveInteger(v) ? BI.i18nText("BI-Please_Input_Positive_Integer") : BI.i18nText("BI-Year_Trigger_Invalid_Text"); }, watermark: BI.i18nText("BI-Basic_Unrestricted"), hgap: c.hgap,