forked from sylvainjule/kirby-bouncer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1 lines (1 loc) · 1.65 KB
/
index.js
1
(()=>{(function(){"use strict";var h=function(){var e=this,s=e.$createElement,i=e._self._c||s;return e.show?i("div",{staticClass:"bouncer-nav"},[i("div",{staticClass:"bouncer-nav-inner"},[i("strong",[e._v("Basculer vers :")]),e._l(e.pages,function(o){return i("div",{staticClass:"page"},[i("k-link",{attrs:{to:o.path}},[e._v(e._s(o.title))])],1)})],2)]):e._e()},v=[],y="";function f(e,s,i,o,a,_,l,$){var n=typeof e=="function"?e.options:e;s&&(n.render=s,n.staticRenderFns=i,n._compiled=!0),o&&(n.functional=!0),_&&(n._scopeId="data-v-"+_);var r;if(l?(r=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!t&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},n._ssrRegister=r):a&&(r=$?function(){a.call(this,(n.functional?this.parent:this).$root.$options.shadowRoot)}:a),r)if(n.functional){n._injectStyles=r;var m=n.render;n.render=function(b,d){return r.call(d),m(b,d)}}else{var c=n.beforeCreate;n.beforeCreate=c?[].concat(c,r):[r]}return{exports:e,options:n}}const p={data(){return{user:void 0}},created(){this.$api.get("current-user").then(e=>{this.user=e,this.showBar(e)&&this.$root.$el.classList.add("bouncer-padding-top")})},computed:{show(){return this.showBar(this.user)},pages(){return this.show?this.user.allowed.filter(e=>e.path!=this.parent):[]}},methods:{showBar(e){return e&&e.nav&&Array.isArray(e.allowed)&&e.allowed.length>1}}},u={};var C=f(p,h,v,!1,g,null,null,null);function g(e){for(let s in u)this[s]=u[s]}var w=function(){return C.exports}();panel.plugin("sylvainjule/bouncer",{sections:{bouncernav:w}})})();})();