Skip to content

Commit

Permalink
Merge 8f6da71 into 9fa2273
Browse files Browse the repository at this point in the history
  • Loading branch information
mrflix committed Sep 22, 2021
2 parents 9fa2273 + 8f6da71 commit 3699a9d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions index.php
Expand Up @@ -90,6 +90,9 @@
'intab' => function ($intab = false) {
return \Bnomei\Janitor::isTrue($intab);
},
'confirm' => function ($confirm = '') {
return $confirm;
},
'pageURI' => function () {
$uri = kirby()->site()->homePageId();
if (is_a($this->model(), \Kirby\Cms\Page::class)) {
Expand Down
5 changes: 5 additions & 0 deletions src/components/fields/Janitor.vue
Expand Up @@ -31,6 +31,7 @@ export default {
unsaved: Boolean,
autosave: Boolean,
intab: Boolean,
confirm: String,
icon: [Boolean, String],
},
data() {
Expand All @@ -39,6 +40,7 @@ export default {
downloadRequest: '',
clipboardRequest: '',
urlRequest: '',
confirm: '',
}
},
created() {
Expand Down Expand Up @@ -86,6 +88,9 @@ export default {
}
},
janitor() {
if (this.confirm !== '' && !window.confirm(this.confirm)) {
return;
}
if (this.autosave === true && this.pageHasChanges) {
// lock janitor button, press save and listen to model.update event
Expand Down

0 comments on commit 3699a9d

Please sign in to comment.