2926 bug undo feature of multitool delete your upload file (#3101)

# Description of Changes

Please provide a summary of the changes, including:

- What was changed
Added support for single page and multi page undo/redo drag and drop in
multitool
removed selecting pages from undo/redo stack

- Why the change was made
Drag and drop was not supported fully with undo/redo functionality


Closes #(2926)

---

## [Checklist]


### General

- [X] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [X] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [X] I have performed a self-review of my code
- [X] My changes generate no new warnings

### Documentation

### UI Changes

I Will start a demo in PR so people can try the new functionality

[numberedpages.pdf](https://github.com/user-attachments/files/19043978/numberedpages.pdf)
Please feel free to use this PDF to aid with trying out the new
functionality

### Testing (if applicable)


- [X] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
ConnorYoh
2025-03-05 08:40:03 +00:00
committed by GitHub
parent 58edc777c0
commit e6abffe1a1
6 changed files with 64 additions and 74 deletions
@@ -35,8 +35,7 @@ class PdfActionsManager {
const sibling = imgContainer.previousSibling;
if (sibling) {
let movePageCommand = this.movePageTo(imgContainer, sibling, true, true);
this._pushUndoClearRedo(movePageCommand);
this.movePageTo(imgContainer, sibling, true);
}
}
@@ -44,12 +43,11 @@ class PdfActionsManager {
var imgContainer = this.getPageContainer(e.target);
const sibling = imgContainer.nextSibling;
if (sibling) {
let movePageCommand = this.movePageTo(
this.movePageTo(
imgContainer,
sibling.nextSibling,
true
);
this._pushUndoClearRedo(movePageCommand);
}
}
@@ -185,8 +183,6 @@ class PdfActionsManager {
const pageNumber = Array.from(div.parentNode.children).indexOf(div) + 1;
let selectPageCommand = new SelectPageCommand(pageNumber, selectCheckbox);
selectPageCommand.execute();
this._pushUndoClearRedo(selectPageCommand);
};
const insertFileButtonContainer = document.createElement("div");