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-06 06:28:43 +02:00
|
|
|
get category() {return "appearance";}
|
|
|
|
get id() {return "minimalMode";}
|
|
|
|
get hideChannelsID() {return "hideChannels";}
|
2019-05-30 23:18:52 +02:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
};
|