You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/views/content/root_page.js

58 lines
1.2 KiB

// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS206: Consider reworking classes to avoid initClass
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
app.views.RootPage = class RootPage extends app.View {
static initClass() {
1 year ago
this.events = { click: "onClick" };
}
init() {
1 year ago
if (!this.isHidden()) {
this.setHidden(false);
} // reserve space in local storage
this.render();
}
render() {
this.empty();
1 year ago
const tmpl = app.isAndroidWebview()
? "androidWarning"
: this.isHidden()
? "splash"
: app.isMobile()
? "mobileIntro"
: "intro";
this.append(this.tmpl(tmpl));
}
hideIntro() {
this.setHidden(true);
this.render();
}
setHidden(value) {
1 year ago
app.settings.set("hideIntro", value);
}
isHidden() {
1 year ago
return app.isSingleDoc() || app.settings.get("hideIntro");
}
onRoute() {}
onClick(event) {
1 year ago
if ($.eventTarget(event).hasAttribute("data-hide-intro")) {
$.stopEvent(event);
this.hideIntro();
}
}
};
app.views.RootPage.initClass();