Skip to content

Commit

Permalink
Disable undo/redo on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Dec 19, 2024
1 parent 1544d60 commit 6594e9b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/common/main/lib/view/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,10 @@ define([
!Common.localStorage.getBool(me.appPrefix + 'quick-access-save', true) && me.btnSave.hide();
}
me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true, undefined, undefined, 'Z',
[Common.enumLock.undoLock, Common.enumLock.fileMenuOpened]);
[Common.enumLock.undoLock, Common.enumLock.fileMenuOpened, Common.enumLock.lostConnect]);
!Common.localStorage.getBool(me.appPrefix + 'quick-access-undo', true) && me.btnUndo.hide();
me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true, undefined, undefined, 'Y',
[Common.enumLock.redoLock, Common.enumLock.fileMenuOpened]);
[Common.enumLock.redoLock, Common.enumLock.fileMenuOpened, Common.enumLock.lostConnect]);
!Common.localStorage.getBool(me.appPrefix + 'quick-access-redo', true) && me.btnRedo.hide();
me.btnQuickAccess = new Common.UI.Button({
cls: 'btn-header no-caret',
Expand Down
2 changes: 2 additions & 0 deletions apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,8 @@ define([
app.getController('Toolbar').getView('Toolbar').fireEvent('docmode:disabled', [disable]);
if (options.header.search)
appHeader && appHeader.lockHeaderBtns('search', disable);
appHeader && appHeader.lockHeaderBtns('undo', options.viewMode, Common.enumLock.lostConnect);
appHeader && appHeader.lockHeaderBtns('redo', options.viewMode, Common.enumLock.lostConnect);
}

if (prev_options) {
Expand Down
2 changes: 2 additions & 0 deletions apps/pdfeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@ define([
app.getController('Toolbar').getView('Toolbar').fireEvent('docmode:disabled', [disable]);
if (options.header.search)
appHeader && appHeader.lockHeaderBtns('search', disable);
appHeader && appHeader.lockHeaderBtns('undo', options.viewMode, Common.enumLock.lostConnect);
appHeader && appHeader.lockHeaderBtns('redo', options.viewMode, Common.enumLock.lostConnect);
}

if (options.shortcuts) {
Expand Down
2 changes: 2 additions & 0 deletions apps/presentationeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,8 @@ define([
if (options.header) {
if (options.header.search)
appHeader && appHeader.lockHeaderBtns('search', disable);
appHeader && appHeader.lockHeaderBtns('undo', options.viewMode, Common.enumLock.lostConnect);
appHeader && appHeader.lockHeaderBtns('redo', options.viewMode, Common.enumLock.lostConnect);
}

if (prev_options) {
Expand Down
2 changes: 2 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,8 @@ define([
if (options.header) {
if (options.header.search)
this.headerView && this.headerView.lockHeaderBtns('search', disable);
this.headerView && this.headerView.lockHeaderBtns('undo', options.viewMode, Common.enumLock.lostConnect);
this.headerView && this.headerView.lockHeaderBtns('redo', options.viewMode, Common.enumLock.lostConnect);
}

if (prev_options) {
Expand Down
2 changes: 2 additions & 0 deletions apps/visioeditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ define([
if (options.header) {
if (options.header.search)
appHeader && appHeader.lockHeaderBtns('search', disable);
appHeader && appHeader.lockHeaderBtns('undo', options.viewMode, Common.enumLock.lostConnect);
appHeader && appHeader.lockHeaderBtns('redo', options.viewMode, Common.enumLock.lostConnect);
}

if (options.shortcuts) {
Expand Down

0 comments on commit 6594e9b

Please sign in to comment.