Browse Source

优化样式

es6
guy 3 years ago
parent
commit
79e9d72f3e
  1. 6
      src/base/combination/combo.js
  2. 6
      src/case/calendar/calendar.date.item.js
  3. 16
      src/case/calendar/calendar.js
  4. 1
      src/core/constant/var.js
  5. 4
      src/widget/date/calendar/popup.calendar.date.js

6
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);
},

6
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);
BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem);

16
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);
BI.shortcut("bi.calendar", BI.Calendar);

1
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,

4
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);
BI.shortcut("bi.date_calendar_popup", BI.DateCalendarPopup);

Loading…
Cancel
Save