app/assets/build/coco/book.js in coveragebook_components-0.8.1 vs app/assets/build/coco/book.js in coveragebook_components-0.8.2
- old
+ new
@@ -15192,10 +15192,23 @@
// ../../components/coco/base/modal/modal.js
var modal_exports = {};
__export(modal_exports, {
default: () => modal_default
});
+
+ // helpers/location.js
+ function navigateTo(url, options = {}) {
+ if (window.Turbo && options.turbo !== false) {
+ delete options.turbo;
+ turboOptions = Object.assign({ action: "advance" }, options);
+ window.Turbo.visit(url, turboOptions);
+ } else {
+ location.assign(url);
+ }
+ }
+
+ // ../../components/coco/base/modal/modal.js
var modal_default = CocoComponent("modal", () => {
return {
open: false,
frame: null,
modal: null,
@@ -15222,9 +15235,12 @@
}, 200);
},
dismiss(event) {
if (this.$options.dismissable)
this.hide();
+ },
+ visit(url) {
+ navigateTo(url, { frame: this.frame.id });
},
scrollTo(pos) {
setTimeout(() => {
this.$root.scrollTop = pos + this.contentOffsetTop;
}, 10);