app/assets/build/coco/app.js in coveragebook_components-0.6.2 vs app/assets/build/coco/app.js in coveragebook_components-0.6.3
- old
+ new
@@ -14602,11 +14602,11 @@
// ../../../package.json
var package_default = {
name: "coveragebook-components",
type: "module",
- version: "0.6.2",
+ version: "0.6.3",
main: "index.js",
repository: "git@github.com:coveragebook/coco.git",
author: "Mark Perkins <mark@coveragebook.com>",
license: "NO LICENSE",
browserslist: [
@@ -29719,10 +29719,19 @@
(value, oldValue) => this.history.add(name, value, oldValue)
);
});
this.ready = true;
});
+ this.$watch("history.undoable", (undoable) => {
+ if (undoable) {
+ window.onbeforeunload = () => {
+ return true;
+ };
+ } else {
+ window.onbeforeunload = null;
+ }
+ });
},
undo(name, value) {
this[name] = value;
this.$nextTick(() => this.updateTextareaSizes());
},
@@ -29804,10 +29813,18 @@
if (file && file instanceof File) {
dataTransfer.items.add(file);
}
input.files = dataTransfer.files;
},
+ handleSlideClick(event) {
+ if (Array.from(event.target.classList).includes("slide-text")) {
+ event.target.querySelector("textarea").focus();
+ }
+ },
+ get blankTextAreasList() {
+ return ["title", "text1", "text2"].map((textareaName) => this[textareaName] === "" ? textareaName : "").join(" ").trim();
+ },
get hasBgImage() {
return !!(this.bgImage && this.bgImage.data);
},
get hasImage1() {
return !!(this.image1 && this.image1.data);
@@ -31975,10 +31992,10 @@
const textarea = this.$refs.textarea;
if (textarea) {
const styles = window.getComputedStyle(textarea);
const fontSize = styles.getPropertyValue("font-size");
textarea.style.height = "4px";
- let newHeight = textarea.scrollHeight - parseInt(fontSize, 10) * 0.16;
+ let newHeight = textarea.scrollHeight;
textarea.style.height = `${newHeight}px`;
if (this.height !== newHeight) {
this.height = newHeight;
}
}