Skip to content

Commit

Permalink
fix: dialog loading tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandrfedorov97 committed Sep 18, 2024
1 parent 9a67b49 commit 5d75360
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/resources/templates/editor.vm
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ $webResourceManager.requireResource("onlyoffice.onlyoffice-confluence-plugin:onl
);
};

var waitLoading = function (dialog, callback) {
if (dialog.find(".tree").first().hasClass('loading')) {
setTimeout(function() {
waitLoading(dialog, callback)
}, 100);
} else {
callback();
}
}

var moveHandler = function () {
$("#move-page-dialog").find("#move-errors").remove();
$("#move-page-dialog").find(".error").remove();
Expand Down Expand Up @@ -285,7 +295,7 @@ $webResourceManager.requireResource("onlyoffice.onlyoffice-confluence-plugin:onl
AJS.Confluence.MovePageDialog(paramsDialog);
var dialog = $("#move-page-dialog");

dialog.find(".tree").on("DOMNodeInserted", function() {
waitLoading(dialog, function() {
if (dialog.find("form.aui").length != 0 && dialog.find("#file-name-input").length == 0) {
dialog.find("form.aui").prepend($(
'<div class="field-group">' +
Expand Down

0 comments on commit 5d75360

Please sign in to comment.