PageSourceSearch

https://rockwatergallery.co.uk/assets/overlay-mixin.781011c3.js

js rockwatergallery.co.uk collected 2026-09-29 02:36:25 UTC 2,628 bytes, 2 lines download raw bytes

1import{o as s}from"./index.474d7b13.js";const i=(e,t)=>{const o=Object.assign({},e);return Object.entries(t).forEach(n=>{o[n[0]]=n[1]}),o},r={props:{name:{type:String,required:!0},title:{type:[String,Number]},immutable:{type:Boolean,default:!1},stage:{type:[String,Number],default:1},startOpen:{type:Boolean,default:!1},disableRouteChanges:{type:Boolean,default:!1}},data(){return{isOpen:!1,popupTitle:null,elementState:null,overlayStage:this.stage}},computed:{queryParamKey(){return`overlay-${this.name}`}},methods:{open(){s.open(this.name),this.$emit("open")},close(){s.close(this.name),this.$emit("close")},toggle(){this.open?this.close():this.open()},setTitle(e){if(e){this.popupTitle=e;return}if(this.title){this.popupTitle=this.title;return}this.popupTitle=null},_clickOutside(e){!e.preventDismissal&&!e.preventClose&&!this.immutable?this.close():this.$emit("close-prevented")},_clickInside(e){e.preventClose=!0},_openElement(e){if(this.name===e&&!this.isOpen){if(!this.disableRouteChanges){const t=i(this.$route.query,{[this.queryParamKey]:this.overlayStage||1});this.$router.push(Object.assign({},this.$route,{query:t}))}this.$nextTick(()=>{this.isOpen=!0,this.$emit("open")})}},_toggleElement(e){this.isOpen?this._closeElement(e):this._openElement(e)},_changeElementState(){if(!this.disableRouteChanges){const e=i(this.$route.query,{[this.queryParamKey]:this.elementState.name});this.$router.push(Object.assign({},this.$route,{query:e}))}},_closeElement(e){if(this.name===e){if(!this.disableRouteChanges){const t=i(this.$route.query,{[this.queryParamKey]:void 0});this.$router.replace(Object.assign({},this.$route,{query:t})).catch(()=>{})}this.$nextTick(()=>{this.isOpen=!1})}},_keydown(e){e.keyCode===27&&this.isOpen&&!this.immutable&&this.close()},_onMouseDown(e,t){t&&e.button===0&&this._clickOutside(e),t||this._clickInside(e)}},watch:{isOpen:{handler(e){if(!e&&!this.disableRouteChanges){const t=i(this.$route.query,{[this.queryParamKey]:void 0});this.$router.replace(Object.assign({},this.$route,{query:t})).catch(()=>{})}}},stage:{immediate:!0,handler(e){this.overlayStage=e}},elementState(){this._changeElementState()}},created(){window.addEventListener("keydown",this._keydown),s.on("open-overlay",this._openElement),s.on("toggle-overlay",this._toggleElement),s.on("close-overlay",this._closeElement)},mounted(){this.startOpen&&(this.isOpen=!0)},beforeUnmount(){window.removeEventListener("keydown",this._keydown),s.off("open-overlay",this._openElement),s.off("toggle-overlay",this._toggleElement),s.off("close-overlay",this._closeElement)}};export{r as o};
2//# sourceMappingURL=overlay-mixin.781011c3.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.