Skip to content

Commit 05dcbde

Browse files
committed
Remove unnecessary code
1 parent fed6ad7 commit 05dcbde

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Restrict access of a user role to a specific page (and its children) in the pane
88

99
## Overview
1010

11-
> This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider [making a donation of your choice](https://www.paypal.me/sylvainjule) or purchasing your license(s) through [my affiliate link](https://a.paddle.com/v2/click/1129/36369?link=1170).
11+
> This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider [making a donation of your choice](https://www.paypal.me/sylvainjl) or purchasing your license(s) through [my affiliate link](https://a.paddle.com/v2/click/1129/36369?link=1170).
1212
1313
- [1. Installation](#1-installation)
1414
- [2. Setup](#2-setup)

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,4 @@ panel.plugin('sylvainjule/bouncer', {
44
sections: {
55
bouncernav: BouncerNav
66
},
7-
created(Vue) {
8-
console.log('ok')
9-
},
107
});
11-
12-
function watchUser(app) {
13-
app.$router.afterEach((to, from) => {
14-
updateUser(app)
15-
});
16-
app.$store.watch(
17-
state => {
18-
if (state.user.current) { return state.user.current; }
19-
},
20-
(newUser, oldUser) => {
21-
updateUser(app)
22-
}
23-
)
24-
}
25-
function updateUser(app, user) {
26-
var user = app.$data.user
27-
28-
app.$el.classList.remove('bouncer-padding-top');
29-
30-
if(user && user.nav && Array.isArray(user.restriction) && user.restriction.length > 1) {
31-
var paths = user.restriction.map(el => { return el.path })
32-
33-
if(paths.includes(app.$router.currentRoute.path)) {
34-
app.$el.classList.add('bouncer-padding-top');
35-
}
36-
}
37-
}

0 commit comments

Comments
 (0)