Browse Source

Move PropertyNumberView to TS

pull/4849/head
Artur Arseniev 4 years ago
parent
commit
4104d04b51
  1. 8
      src/style_manager/view/PropertyNumberView.ts
  2. 3
      src/style_manager/view/PropertyView.ts

8
src/style_manager/view/PropertyNumberView.js → src/style_manager/view/PropertyNumberView.ts

@ -1,6 +1,8 @@
import PropertyView from './PropertyView';
export default class PropertyNumberView extends PropertyView {
inputInst?: any;
templateInput() {
return '';
}
@ -19,10 +21,10 @@ export default class PropertyNumberView extends PropertyView {
const { ppfx, model, el } = this;
if (!this.inputInst) {
const { input } = model;
const { input } = model as any;
input.ppfx = ppfx;
input.render();
const fields = el.querySelector(`.${ppfx}fields`);
const fields = el.querySelector(`.${ppfx}fields`)!;
fields.appendChild(input.el);
this.input = input.inputEl.get(0);
this.inputInst = input;
@ -30,7 +32,7 @@ export default class PropertyNumberView extends PropertyView {
}
clearCached() {
PropertyView.prototype.clearCached.apply(this, arguments);
PropertyView.prototype.clearCached.apply(this, arguments as any);
this.inputInst = null;
}
}

3
src/style_manager/view/PropertyView.ts

@ -17,7 +17,6 @@ export default class PropertyView extends View<Property> {
create?: Function;
destroy?: Function;
update?: Function;
onRender?: Function;
emit?: Function;
unset?: Function;
clearEl?: HTMLElement;
@ -266,4 +265,6 @@ export default class PropertyView extends View<Property> {
this.setValue(model.getValue());
return this;
}
onRender() {}
}

Loading…
Cancel
Save