Browse Source

结构化

es6
windy 3 years ago
parent
commit
fd4e4eb973
  1. 15
      src/core/system.js

15
src/core/system.js

@ -6,7 +6,7 @@
// 系统参数常量 // 系统参数常量
!(function () { !(function () {
var system = { var system = {
SIZE: { // 尺寸 size: { // 尺寸
TOOL_BAR_HEIGHT: 24, TOOL_BAR_HEIGHT: 24,
LIST_ITEM_HEIGHT: 24, LIST_ITEM_HEIGHT: 24,
TRIGGER_HEIGHT: 24, TRIGGER_HEIGHT: 24,
@ -14,15 +14,18 @@
}; };
var provider = function () { var provider = function () {
this.inject = function (type, config) {
BI.deepExtend(system[type], config); this.SYSTEM = system;
this.setSize = function (opt) {
BI.deepExtend(system, { size: opt });
}; };
this.$get = function () { this.$get = function () {
return BI.inherit(BI.OB, { return BI.inherit(BI.OB, {
getConfig: function (type) { getSize: function () {
return system[type]; return system.size;
}, },
}); });
}; };
@ -32,5 +35,5 @@
})(); })();
BI.prepares.push(function () { BI.prepares.push(function () {
BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getConfig('SIZE'); BI.SIZE_CONSANTS = BI.Providers.getProvider('bi.provider.system').getSize();
}); });

Loading…
Cancel
Save