Browse Source

优化样式

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

6
src/base/combination/combo.js

@ -312,7 +312,7 @@
delete needHideWhenAnotherComboOpen[this.getName()]; delete needHideWhenAnotherComboOpen[this.getName()];
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + 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); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
@ -336,10 +336,10 @@
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + 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());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); 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); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },

4
src/case/calendar/calendar.date.item.js

@ -21,8 +21,8 @@ BI.CalendarDateItem = BI.inherit(BI.BasicButton, {
}, },
left: o.lgap, left: o.lgap,
right: o.rgap, right: o.rgap,
top: 0, top: o.tgap,
bottom: 0 bottom: o.rgap
}] }]
}; };
}, },

14
src/case/calendar/calendar.js

@ -100,8 +100,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
columns: 7, columns: 7,
rows: 6, rows: 6,
columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7], columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7],
rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, rowSize: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 10
vgap: 10
}))] }))]
}); });
this.days.on(BI.Controller.EVENT_CHANGE, function () { this.days.on(BI.Controller.EVENT_CHANGE, function () {
@ -111,7 +110,10 @@ BI.Calendar = BI.inherit(BI.Widget, {
element: this element: this
}, BI.LogicFactory.createLogic("vertical", BI.extend({}, o.logic, { }, 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", whiteSpace: "normal",
once: false, once: false,
forceSelected: true, forceSelected: true,
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT + 10,
value: o.year + "-" + month + "-" + td.text, value: o.year + "-" + month + "-" + td.text,
disabled: td.lastMonth || td.nextMonth || td.disabled, disabled: td.lastMonth || td.nextMonth || td.disabled,
lgap: 5, lgap: 5,
rgap: 5 rgap: 5,
tgap: 5,
bgap: 5
// selected: td.currentDay // selected: td.currentDay
}); });
}); });

1
src/core/constant/var.js

@ -6,6 +6,7 @@ _.extend(BI, {
MAX: 0xfffffffffffffff, MAX: 0xfffffffffffffff,
MIN: -0xfffffffffffffff, MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200, EVENT_RESPONSE_TIME: 200,
EVENT_BLUR: true,
zIndex_layer: 1e5, zIndex_layer: 1e5,
zIndex_popover: 1e6, zIndex_popover: 1e6,
zIndex_popup: 1e7, zIndex_popup: 1e7,

2
src/widget/date/calendar/popup.calendar.date.js

@ -88,7 +88,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
items: [{ items: [{
el: this.calendar, el: this.calendar,
hgap: 5, hgap: 5,
bgap: 12 bgap: 7
}] }]
}, { }, {
type: "bi.absolute", type: "bi.absolute",

Loading…
Cancel
Save