PDF editor: Support for Ctrl+A

This commit is contained in:
Raphael Michel
2022-03-13 15:16:05 +01:00
committed by Raphael Michel
parent ebae275a2d
commit cc912b9ea7

View File

@@ -825,6 +825,11 @@ var editor = {
case 46: /* Delete */
editor._delete();
break;
case 65: /* A */
if (e.ctrlKey) {
editor._selectAll();
}
break;
case 89: /* Y */
if (e.ctrlKey) {
editor._redo();
@@ -871,6 +876,15 @@ var editor = {
editor.dirty = true;
},
_selectAll: function () {
var group = new fabric.Group(editor.fabric.getObjects(), {
originX: 'center',
originY: 'center',
});
group.setCoords();
editor.fabric.setActiveGroup(group);
},
_undo: function undo() {
if (editor._history_pos < editor.history.length - 1) {
editor._history_modification_in_progress = true;