Skip to content

Commit

Permalink
append share button when don't redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Antipkin-A committed Oct 15, 2021
1 parent 08d7671 commit 6b4ce22
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,14 @@
return;
}

if (oc_appswebroots.richdocuments
var redirect = true;
var flag = /\?redirect=([\w-]{1})/.exec(location.search);
if (flag && flag.length > 0 && flag[1] === "0") {
redirect = false;
}

if (!redirect
|| oc_appswebroots.richdocuments
|| oc_appswebroots.files_pdfviewer && extension === "pdf"
|| oc_appswebroots.files_texteditor && extension === "txt") {

Expand All @@ -457,16 +464,10 @@
button.addEventListener("click", function(event) {
OCA.Onlyoffice.OpenEditor();
});
} else {
var redirect = true;
var flag = /\?redirect=([\w-]{1})/.exec(location.search);
if (flag && flag.length > 0 && flag[1] === "0") {
redirect = false;
}
}

if (redirect) {
OCA.Onlyoffice.OpenEditor(0, "", "", 0, null, redirect);
}
if (redirect) {
OCA.Onlyoffice.OpenEditor(0, "", "", 0, null, redirect);
}
};

Expand Down

0 comments on commit 6b4ce22

Please sign in to comment.