From 79e9d72f3e78f73368b8cf07318b510b1c98ea65 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 1 Nov 2021 21:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 6 +++--- src/case/calendar/calendar.date.item.js | 6 +++--- src/case/calendar/calendar.js | 16 ++++++++++------ src/core/constant/var.js | 1 + src/widget/date/calendar/popup.calendar.date.js | 4 ++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 0798ceae2..64192fe29 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -312,7 +312,7 @@ delete needHideWhenAnotherComboOpen[this.getName()]; BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); - o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); + BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); }, @@ -336,10 +336,10 @@ this.element.addClass(this.options.comboClass); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); - o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); + BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName()); BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); - o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).bind("blur." + this.getName(), BI.bind(this._hideIf, this)); + BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).bind("blur." + this.getName(), BI.bind(this._hideIf, this)); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); }, diff --git a/src/case/calendar/calendar.date.item.js b/src/case/calendar/calendar.date.item.js index b8ee105c6..9da26c663 100644 --- a/src/case/calendar/calendar.date.item.js +++ b/src/case/calendar/calendar.date.item.js @@ -21,8 +21,8 @@ BI.CalendarDateItem = BI.inherit(BI.BasicButton, { }, left: o.lgap, right: o.rgap, - top: 0, - bottom: 0 + top: o.tgap, + bottom: o.rgap }] }; }, @@ -50,4 +50,4 @@ BI.CalendarDateItem = BI.inherit(BI.BasicButton, { return this.text.getValue(); } }); -BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem); \ No newline at end of file +BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem); diff --git a/src/case/calendar/calendar.js b/src/case/calendar/calendar.js index fb762da7e..ddc12c071 100644 --- a/src/case/calendar/calendar.js +++ b/src/case/calendar/calendar.js @@ -100,8 +100,7 @@ BI.Calendar = BI.inherit(BI.Widget, { columns: 7, rows: 6, columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], - rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - vgap: 10 + rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 10 }))] }); this.days.on(BI.Controller.EVENT_CHANGE, function () { @@ -111,7 +110,10 @@ BI.Calendar = BI.inherit(BI.Widget, { element: this }, BI.LogicFactory.createLogic("vertical", BI.extend({}, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("top", title, this.days) + items: BI.LogicFactory.createLogicItemsByDirection("top", title, { + el: this.days, + tgap: -5 + }) })))); }, @@ -159,11 +161,13 @@ BI.Calendar = BI.inherit(BI.Widget, { whiteSpace: "normal", once: false, forceSelected: true, - height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, + height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 10, value: o.year + "-" + month + "-" + td.text, disabled: td.lastMonth || td.nextMonth || td.disabled, lgap: 5, - rgap: 5 + rgap: 5, + tgap: 5, + bgap: 5 // selected: td.currentDay }); }); @@ -231,4 +235,4 @@ BI.extend(BI.Calendar, { } }); -BI.shortcut("bi.calendar", BI.Calendar); \ No newline at end of file +BI.shortcut("bi.calendar", BI.Calendar); diff --git a/src/core/constant/var.js b/src/core/constant/var.js index a5bad8f77..cc767737b 100644 --- a/src/core/constant/var.js +++ b/src/core/constant/var.js @@ -6,6 +6,7 @@ _.extend(BI, { MAX: 0xfffffffffffffff, MIN: -0xfffffffffffffff, EVENT_RESPONSE_TIME: 200, + EVENT_BLUR: true, zIndex_layer: 1e5, zIndex_popover: 1e6, zIndex_popup: 1e7, diff --git a/src/widget/date/calendar/popup.calendar.date.js b/src/widget/date/calendar/popup.calendar.date.js index 9ddf99649..1a353afef 100644 --- a/src/widget/date/calendar/popup.calendar.date.js +++ b/src/widget/date/calendar/popup.calendar.date.js @@ -88,7 +88,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { items: [{ el: this.calendar, hgap: 5, - bgap: 12 + bgap: 7 }] }, { type: "bi.absolute", @@ -148,4 +148,4 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, { }); BI.DateCalendarPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.DateCalendarPopup.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW = "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW"; -BI.shortcut("bi.date_calendar_popup", BI.DateCalendarPopup); \ No newline at end of file +BI.shortcut("bi.date_calendar_popup", BI.DateCalendarPopup);