2020-01-15 21:36:01 +01:00
|
|
|
import Component from "./component.js";
|
|
|
|
|
|
|
|
class BasicWidget extends Component {
|
2020-01-14 20:27:40 +01:00
|
|
|
renderTo($parent) {
|
2020-01-18 18:01:16 +01:00
|
|
|
this.$parent = $parent;
|
|
|
|
|
2020-01-14 20:27:40 +01:00
|
|
|
$parent.append(this.render());
|
|
|
|
}
|
|
|
|
|
2020-01-11 21:19:56 +01:00
|
|
|
render() {
|
2020-01-18 18:01:16 +01:00
|
|
|
return this.doRender();
|
2020-01-11 21:19:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* for overriding
|
|
|
|
*/
|
2020-01-19 09:02:18 +01:00
|
|
|
doRender() {}
|
2020-01-11 21:19:56 +01:00
|
|
|
|
2020-01-14 20:27:40 +01:00
|
|
|
toggle(show) {
|
|
|
|
this.$widget.toggle(show);
|
|
|
|
}
|
|
|
|
|
2020-01-11 21:19:56 +01:00
|
|
|
cleanup() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default BasicWidget;
|