Skip to content

Commit 8b6fbdb

Browse files
committed
Merge branch 'develop'
2 parents ab1a55c + 413bb22 commit 8b6fbdb

File tree

2 files changed

+38
-26
lines changed

2 files changed

+38
-26
lines changed

composer.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
{
2-
"name": "mullema/k3-panel-view-extended",
3-
"description": "Allow single language pages/site/users in a multi language setup, hide buttons in topbar and sections.",
4-
"type": "kirby-plugin",
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Matthias Müller",
9-
"email": "[email protected]"
10-
}
11-
],
12-
"require": {
13-
"getkirby/composer-installer": "^1.1"
14-
}
15-
}
1+
{
2+
"name": "mullema/k3-panel-view-extended",
3+
"description": "Allow single language pages/site/users in a multi language setup, hide buttons in topbar and sections.",
4+
"type": "kirby-plugin",
5+
"license": "MIT",
6+
"version": "4.1",
7+
"authors": [
8+
{
9+
"name": "Matthias Müller",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"require": {
14+
"getkirby/composer-installer": "^1.1"
15+
}
16+
}

index.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,28 @@
44
function extendView (component) {
55
return {
66
extends: component,
7-
mounted: function () {
8-
const options = this.$options.propsData.permissions
7+
mounted () {
8+
this.setExtendOptions()
9+
},
10+
watch: {
11+
// watch for blueprint change
12+
'$props.blueprint' () {
13+
this.setExtendOptions()
14+
}
15+
},
16+
methods: {
17+
setExtendOptions () {
18+
const options = this.$options.propsData.permissions
919

10-
if (options) {
11-
extendOptions.forEach(extendOption => {
12-
if (options[extendOption] === true) {
13-
this.$el.classList.add(extendOption)
14-
} else {
15-
this.$el.classList.remove(extendOption)
16-
}
17-
})
20+
if (options) {
21+
extendOptions.forEach(extendOption => {
22+
if (options[extendOption] === true) {
23+
this.$el.classList.add(extendOption)
24+
} else {
25+
this.$el.classList.remove(extendOption)
26+
}
27+
})
28+
}
1829
}
1930
}
2031
}
@@ -26,7 +37,7 @@
2637
props: {
2738
blueprintOptions: Object
2839
},
29-
mounted: function () {
40+
mounted () {
3041
if (this.blueprintOptions) {
3142
this.$nextTick(() => {
3243
if (this.blueprintOptions.hideOptions === true || this.blueprintOptions.hideSettings === true) this.$el.classList.add('hideSettings')

0 commit comments

Comments
 (0)