Skip to content

Commit

Permalink
Merge pull request #11 from tv2regionerne/fix/prevent-locks-on-create…
Browse files Browse the repository at this point in the history
…-page

Prevent locks on create page
  • Loading branch information
Sylvester Damgaard authored Mar 13, 2024
2 parents cba7fe4 + 1634b03 commit 6d3628a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.

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

2 changes: 1 addition & 1 deletion resources/dist/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resources/js/addon.js": {
"file": "assets/addon-ec9db2e5.js",
"file": "assets/addon-2ef42060.js",
"isEntry": true,
"src": "resources/js/addon.js"
}
Expand Down
9 changes: 8 additions & 1 deletion resources/js/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ Statamic.booted(() => {
}

if (valid && id && ! path.length) {

id = id.split('?').shift();

if (id == 'create') {
continue;
}

Statamic.$components.append('statamic-locks-modal', {
props: { itemType: handle, itemId: id.split('?').shift() }
props: { itemType: handle, itemId: id }
});
}
}
Expand Down

0 comments on commit 6d3628a

Please sign in to comment.