2019-05-30 23:18:52 +02:00
|
|
|
import Builtin, {onSettingChange} from "../structs/builtin";
|
|
|
|
import {SettingsCookie} from "data";
|
|
|
|
|
|
|
|
export default new class MinimalMode extends Builtin {
|
|
|
|
get name() {return "MinimalMode";}
|
2019-06-05 06:30:24 +02:00
|
|
|
get group() {return "appearance";}
|
2019-05-30 23:18:52 +02:00
|
|
|
get id() {return "bda-gs-2";}
|
|
|
|
get hideChannelsID() {return "bda-gs-3";}
|
|
|
|
get hideChannels() {return SettingsCookie[this.hideChannelsID];}
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.enableHideChannels = this.enableHideChannels.bind(this);
|
|
|
|
this.disableHideChannels = this.disableHideChannels.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
enabled() {
|
|
|
|
$("body").addClass("bd-minimal");
|
|
|
|
if (this.hideChannels) this.enableHideChannels();
|
|
|
|
this.hideChannelCancel = onSettingChange(this.category, this.hideChannelsID, this.enableHideChannels, this.disableHideChannels);
|
|
|
|
}
|
|
|
|
|
|
|
|
disabled() {
|
|
|
|
$("body").removeClass("bd-minimal");
|
|
|
|
if (this.hideChannels) this.disableHideChannels();
|
|
|
|
if (this.hideChannelCancel) this.hideChannelCancel();
|
|
|
|
}
|
|
|
|
|
|
|
|
enableHideChannels() {
|
|
|
|
$("body").addClass("bd-minimal-chan");
|
|
|
|
}
|
|
|
|
|
|
|
|
disableHideChannels() {
|
|
|
|
$("body").removeClass("bd-minimal-chan");
|
|
|
|
}
|
|
|
|
};
|