optimize js code
This commit is contained in:
@@ -318,6 +318,9 @@ class View {
|
||||
getLocationOnScreen(context) {
|
||||
return this.nativeChannel(context, "getLocationOnScreen")();
|
||||
}
|
||||
set props(props) {
|
||||
this.apply(props);
|
||||
}
|
||||
doAnimation(context, animation) {
|
||||
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
|
||||
for (let key in args) {
|
||||
@@ -753,9 +756,7 @@ function stack(views, config) {
|
||||
ret.addChild(v);
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -766,9 +767,7 @@ function hlayout(views, config) {
|
||||
ret.addChild(v);
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -779,9 +778,7 @@ function vlayout(views, config) {
|
||||
ret.addChild(v);
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -794,9 +791,7 @@ function flexlayout(views, config) {
|
||||
ret.addChild(v);
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1444,9 +1439,7 @@ __decorate$a([
|
||||
function text(config) {
|
||||
const ret = new Text;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1613,9 +1606,7 @@ __decorate$9([
|
||||
function image(config) {
|
||||
const ret = new Image;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1741,9 +1732,7 @@ __decorate$8([
|
||||
], List.prototype, "bounces", void 0);
|
||||
function list(config) {
|
||||
const ret = new List;
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
function listItem(item, config) {
|
||||
@@ -1758,9 +1747,7 @@ function listItem(item, config) {
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(it, key, Reflect.get(config, key, config), it);
|
||||
}
|
||||
it.apply(config);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1839,9 +1826,7 @@ __decorate$7([
|
||||
], Slider.prototype, "bounces", void 0);
|
||||
function slider(config) {
|
||||
const ret = new Slider;
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
function slideItem(item, config) {
|
||||
@@ -1876,9 +1861,7 @@ function scroller(content, config) {
|
||||
return (new Scroller).also(v => {
|
||||
v.layoutConfig = layoutConfig().fit();
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(v, key, Reflect.get(config, key, config), v);
|
||||
}
|
||||
v.apply(config);
|
||||
}
|
||||
v.content = content;
|
||||
});
|
||||
@@ -1961,9 +1944,7 @@ __decorate$5([
|
||||
function refreshable(config) {
|
||||
const ret = new Refreshable;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
function pullable(v, config) {
|
||||
@@ -2184,9 +2165,7 @@ function flowItem(item, config) {
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(it, key, Reflect.get(config, key, config), it);
|
||||
}
|
||||
it.apply(config);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2320,9 +2299,7 @@ exports.InputType = void 0;
|
||||
function input(config) {
|
||||
const ret = new Input;
|
||||
ret.layoutConfig = layoutConfig().just();
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2386,9 +2363,7 @@ function draggable(views, config) {
|
||||
});
|
||||
}
|
||||
if (config) {
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -2429,9 +2404,7 @@ function switchView(config) {
|
||||
ret.layoutConfig = layoutConfig().just();
|
||||
ret.width = 50;
|
||||
ret.height = 30;
|
||||
for (let key in config) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
|
||||
}
|
||||
ret.apply(config);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user