|
|
|
@ -1,26 +1,13 @@
|
|
|
|
|
// 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
|
|
|
|
|
*/
|
|
|
|
|
(function () {
|
|
|
|
|
let MIN = undefined;
|
|
|
|
|
let MAX = undefined;
|
|
|
|
|
app.views.Resizer = class Resizer extends app.View {
|
|
|
|
|
static initClass() {
|
|
|
|
|
this.className = "_resizer";
|
|
|
|
|
static className = "_resizer";
|
|
|
|
|
|
|
|
|
|
this.events = {
|
|
|
|
|
static events = {
|
|
|
|
|
dragstart: "onDragStart",
|
|
|
|
|
dragend: "onDragEnd",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MIN = 260;
|
|
|
|
|
MAX = 600;
|
|
|
|
|
}
|
|
|
|
|
static MIN = 260;
|
|
|
|
|
static MAX = 600;
|
|
|
|
|
|
|
|
|
|
static isSupported() {
|
|
|
|
|
return "ondragstart" in document.createElement("div") && !app.isMobile();
|
|
|
|
@ -36,7 +23,7 @@
|
|
|
|
|
if (!(value > 0)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
value = Math.min(Math.max(Math.round(value), MIN), MAX);
|
|
|
|
|
value = Math.min(Math.max(Math.round(value), Resizer.MIN), Resizer.MAX);
|
|
|
|
|
const newSize = `${value}px`;
|
|
|
|
|
document.documentElement.style.setProperty("--sidebarWidth", newSize);
|
|
|
|
|
if (save) {
|
|
|
|
@ -47,6 +34,7 @@
|
|
|
|
|
onDragStart(event) {
|
|
|
|
|
event.dataTransfer.effectAllowed = "link";
|
|
|
|
|
event.dataTransfer.setData("Text", "");
|
|
|
|
|
this.onDrag = this.onDrag.bind(this);
|
|
|
|
|
$.on(window, "dragover", this.onDrag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -76,6 +64,3 @@
|
|
|
|
|
this.resize(value, true);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
app.views.Resizer.initClass();
|
|
|
|
|
return app.views.Resizer;
|
|
|
|
|
})();
|
|
|
|
|