|
|
|
@ -1,37 +1,22 @@
|
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
|
// Sanity-check the conversion and remove this comment.
|
|
|
|
|
/*
|
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
|
* DS101: Remove unnecessary use of Array.from
|
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
|
* DS205: Consider reworking code to avoid use of IIFEs
|
|
|
|
|
* DS206: Consider reworking classes to avoid initClass
|
|
|
|
|
* DS207: Consider shorter variations of null checks
|
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
|
|
|
|
|
*/
|
|
|
|
|
(function () {
|
|
|
|
|
let SIDEBAR_HIDDEN_LAYOUT = undefined;
|
|
|
|
|
app.views.Settings = class Settings extends app.View {
|
|
|
|
|
static initClass() {
|
|
|
|
|
SIDEBAR_HIDDEN_LAYOUT = "_sidebar-hidden";
|
|
|
|
|
static SIDEBAR_HIDDEN_LAYOUT = "_sidebar-hidden";
|
|
|
|
|
|
|
|
|
|
this.el = "._settings";
|
|
|
|
|
static el = "._settings";
|
|
|
|
|
|
|
|
|
|
this.elements = {
|
|
|
|
|
static elements = {
|
|
|
|
|
sidebar: "._sidebar",
|
|
|
|
|
saveBtn: 'button[type="submit"]',
|
|
|
|
|
backBtn: "button[data-back]",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.events = {
|
|
|
|
|
static events = {
|
|
|
|
|
import: "onImport",
|
|
|
|
|
change: "onChange",
|
|
|
|
|
submit: "onSubmit",
|
|
|
|
|
click: "onClick",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.shortcuts = { enter: "onEnter" };
|
|
|
|
|
}
|
|
|
|
|
static shortcuts = { enter: "onEnter" };
|
|
|
|
|
|
|
|
|
|
init() {
|
|
|
|
|
this.addSubview((this.docPicker = new app.views.DocPicker()));
|
|
|
|
@ -40,7 +25,7 @@
|
|
|
|
|
activate() {
|
|
|
|
|
if (super.activate(...arguments)) {
|
|
|
|
|
this.render();
|
|
|
|
|
document.body.classList.remove(SIDEBAR_HIDDEN_LAYOUT);
|
|
|
|
|
document.body.classList.remove(Settings.SIDEBAR_HIDDEN_LAYOUT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -48,8 +33,8 @@
|
|
|
|
|
if (super.deactivate(...arguments)) {
|
|
|
|
|
this.resetClass();
|
|
|
|
|
this.docPicker.detach();
|
|
|
|
|
if (app.settings.hasLayout(SIDEBAR_HIDDEN_LAYOUT)) {
|
|
|
|
|
document.body.classList.add(SIDEBAR_HIDDEN_LAYOUT);
|
|
|
|
|
if (app.settings.hasLayout(Settings.SIDEBAR_HIDDEN_LAYOUT)) {
|
|
|
|
|
document.body.classList.add(Settings.SIDEBAR_HIDDEN_LAYOUT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -79,7 +64,7 @@
|
|
|
|
|
const disabledDocs = new app.collections.Docs(
|
|
|
|
|
(() => {
|
|
|
|
|
const result = [];
|
|
|
|
|
for (var doc of Array.from(app.docs.all())) {
|
|
|
|
|
for (var doc of app.docs.all()) {
|
|
|
|
|
if (docs.indexOf(doc.slug) === -1) {
|
|
|
|
|
result.push(doc);
|
|
|
|
|
}
|
|
|
|
@ -122,6 +107,3 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
app.views.Settings.initClass();
|
|
|
|
|
return app.views.Settings;
|
|
|
|
|
})();
|
|
|
|
|