Skip to content

Commit

Permalink
Merge pull request #223 from OlliL/fix_edit_anchor
Browse files Browse the repository at this point in the history
Ctrl + E shortcut - remove the anchor part of the URL to make the edit link work
  • Loading branch information
Zavy86 authored Dec 3, 2024
2 parents 897bfe5 + 00b1ad8 commit a9dc024
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.69
1.0.70
3 changes: 2 additions & 1 deletion scripts/editor-shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ document.addEventListener('keydown', function(event) {
event.preventDefault(); // Prevent the default behavior

// Check if the URL does not contain '?edit' or '&edit' to confirm we are not in edit mode
// Any present anchor gets removed additionally to make the edit-URL work
if (!window.location.href.includes('?edit') && !window.location.href.includes('&edit')) {
// Redirect to edit mode
var currentUrl = window.location.href;
var currentUrl = window.location.href.split('#')[0];
var editUrl = currentUrl.includes('?') ? currentUrl + '&edit' : currentUrl + '?edit';
window.location.href = editUrl;
}
Expand Down

0 comments on commit a9dc024

Please sign in to comment.