fix: hide widget not working
This commit is contained in:
parent
2748bb78bf
commit
d6d732cf91
1 changed files with 7 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ export default class Widget {
|
|||
constructor(opts) {
|
||||
Object.assign(this, opts);
|
||||
this.make();
|
||||
this.apply_hidden_state();
|
||||
}
|
||||
|
||||
refresh() {
|
||||
|
|
@ -197,4 +198,10 @@ export default class Widget {
|
|||
set_footer() {
|
||||
//
|
||||
}
|
||||
|
||||
apply_hidden_state() {
|
||||
const is_hidden = Boolean(this.hidden);
|
||||
const show_for_customize = is_hidden && this.in_customize_mode;
|
||||
this.widget.toggleClass("hidden", is_hidden && !show_for_customize);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue