2021-05-17 21:46:18 +02:00
|
|
|
import BasicWidget from "./basic_widget.js";
|
|
|
|
|
2021-05-24 22:29:49 +02:00
|
|
|
const TPL = `<div class="spacer"></div>`;
|
2021-05-17 21:46:18 +02:00
|
|
|
|
|
|
|
export default class SpacerWidget extends BasicWidget {
|
2021-06-05 14:12:17 +02:00
|
|
|
constructor(baseSize = 0, growIndex = 1000, shrinkIndex = 1000) {
|
2021-05-24 22:29:49 +02:00
|
|
|
super();
|
|
|
|
|
2021-06-05 14:12:17 +02:00
|
|
|
this.baseSize = baseSize;
|
2021-05-24 22:29:49 +02:00
|
|
|
this.growIndex = growIndex;
|
2021-06-05 14:12:17 +02:00
|
|
|
this.shrinkIndex = shrinkIndex;
|
2021-05-24 22:29:49 +02:00
|
|
|
}
|
|
|
|
|
2021-05-17 21:46:18 +02:00
|
|
|
doRender() {
|
|
|
|
this.$widget = $(TPL);
|
2021-06-05 14:12:17 +02:00
|
|
|
this.$widget.css("flex-basis", this.baseSize);
|
|
|
|
this.$widget.css("flex-grow", this.growIndex);
|
|
|
|
this.$widget.css("flex-shrink", this.shrinkIndex);
|
2021-05-17 21:46:18 +02:00
|
|
|
}
|
|
|
|
}
|