vue-pushpin
Version:
a simple pushpin
1 lines • 2.93 kB
JavaScript
!function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){null==window.vueComps&&(window.vueComps={}),window.vueComps.pushpin=o(4)},function(t,e){(function(){var e;e=function(){var t,e;return t=document.body,e=document.documentElement,document.height||Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)},t.exports={methods:{getDocumentHeight:e}}}).call(this)},function(t,e){(function(){var e,o,n,r;r=!1,e=[],n=function(){var t;return r?void 0:(t=arguments,r=!0,window.requestAnimationFrame?window.requestAnimationFrame(function(){return o.apply(null,t)}):setTimeout(function(){return o.apply(null,t)},66))},o=function(){var t,o,n;for(o=0,n=e.length;n>o;o++)t=e[o],t.apply(null,arguments);return r=!1},window.addEventListener("scroll",n),t.exports={data:function(){return{scrollCbDisposables:[]}},methods:{onWindowScroll:function(t){var o;return e.push(t),o=function(){var o;return o=e.indexOf(t),o>-1?e.splice(o,1):void 0},this.scrollCbDisposables.push(o),function(t){return function(){var e;return o(),e=t.scrollCbDisposables.indexOf(o),e>-1?t.scrollCbDisposables.splice(e,1):void 0}}(this)}},beforeDestroy:function(){var t,e,o,n,r;for(o=this.scrollCbDisposables,n=[],t=0,e=o.length;e>t;t++)r=o[t],n.push(r());return n}}}).call(this)},function(t,e){(function(){var e,o,n;o=function(t){return"string"==typeof t||t instanceof String},n=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},e=function(t){var e,r,i,s,u,l;if(Array.isArray(t))return t;if(o(t)){for(s={},l=t.split(";"),e=0,i=l.length;i>e;e++)u=l[e],r=u.split(":"),s[n(r[0])]=n(r[1]);return[s]}return[t]},t.exports={computed:{computedStyle:function(){var t;return t=e(this.style),null==this.mergeStyle?t:e(this.mergeStyle).concat(t)}}}}).call(this)},function(t,e,o){t.exports={mixins:[o(2),o(1),o(3)],props:{style:{"default":function(){return[]}},top:{type:Number,"default":0,coerce:Number},offset:{type:Number,"default":0,coerce:Number},bottom:{type:Number,"default":0,coerce:Number}},data:function(){return{mergeStyle:{}}},methods:{calc:function(){var t,e,o,n;return t=document.body,e=document.documentElement,n=window.pageYOffset||e.scrollTop||t.scrollTop,this.bottom&&(o=this.getDocumentHeight()),n+this.offset<this.top?this.mergeStyle={top:this.top+"px",position:"absolute"}:this.bottom&&n+this.offset>o-this.bottom?this.mergeStyle={top:o-this.bottom+"px",position:"absolute"}:"fixed"!==this.mergeStyle.position?this.mergeStyle={top:this.offset+"px",position:"fixed"}:void 0}},compiled:function(){return this.onWindowScroll(this.calc)},attached:function(){return this.calc()}},t.exports.__esModule&&(t.exports=t.exports["default"]),("function"==typeof t.exports?t.exports.options:t.exports).template="<div v-bind:style=computedStyle><slot></slot></div>"}]);