app/assets/build/coco/book.js in coveragebook_components-0.7.9 vs app/assets/build/coco/book.js in coveragebook_components-0.7.10

- old
+ new

@@ -14393,10 +14393,31 @@ return isElement2(targets) ? instances[0] : instances; } tippy.defaultProps = defaultProps; tippy.setDefaultProps = setDefaultProps; tippy.currentInput = currentInput; + var hideAll = function hideAll2(_temp) { + var _ref = _temp === void 0 ? {} : _temp, excludedReferenceOrInstance = _ref.exclude, duration = _ref.duration; + mountedInstances.forEach(function(instance) { + var isExcluded = false; + if (excludedReferenceOrInstance) { + isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper; + } + if (!isExcluded) { + var originalDuration = instance.props.duration; + instance.setProps({ + duration + }); + instance.hide(); + if (!instance.state.isDestroyed) { + instance.setProps({ + duration: originalDuration + }); + } + } + }); + }; var applyStylesModifier = Object.assign({}, applyStyles_default, { effect: function effect6(_ref) { var state = _ref.state; var initialStyles = { popper: { @@ -15186,10 +15207,11 @@ this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd); this.$nextTick(() => this.show()); }, show() { this.open = true; + hideAll(); setTimeout(() => { this.$dispatch("modal:shown"); }, 400); }, hide() { @@ -15304,15 +15326,15 @@ close() { this.modal.hide(); }, imageLoaded() { this.loaded = true; - this.$nextTick(() => { + setTimeout(() => { const scrollTop = parseInt(this.img.dataset.scrollTop, 10); if (!isNaN(scrollTop) && scrollTop !== 0) { this.modal.scrollTo(scrollTop); } - }); + }, 200); }, get img() { return this.$refs.media.querySelector("img"); }, root: {