From e07a6caca4c778abaa2bb240a0bf2a393ce21c34 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 21 Jun 2019 15:19:56 +0300 Subject: [PATCH] [PE][SSE] Lock document info settings --- .../main/app/view/FileMenuPanels.js | 11 ++++++++++- .../main/resources/less/leftmenu.less | 5 +++++ .../spreadsheeteditor/main/app/view/FileMenuPanels.js | 11 ++++++++++- .../main/resources/less/leftmenu.less | 5 +++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index eb3340c67..476ed2a12 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -720,7 +720,7 @@ define([ this.tblAuthor.on('click', function(e) { var btn = $(e.target); - if (btn.hasClass('close')) { + if (btn.hasClass('close') && !btn.hasClass('disabled')) { var el = btn.closest('tr'), idx = me.tblAuthor.find('tr').index(el); el.remove(); @@ -882,10 +882,19 @@ define([ setApi: function(o) { this.api = o; + this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this)); this.updateInfo(this.doc); return this; }, + onLockCore: function(lock) { + this.inputTitle.setDisabled(lock); + this.inputSubject.setDisabled(lock); + this.inputComment.setDisabled(lock); + this.inputAuthor.setDisabled(lock); + this.tblAuthor.find('.close').toggleClass('disabled', lock); + }, + txtPlacement: 'Location', txtOwner: 'Owner', txtUploaded: 'Uploaded', diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 9c0244e73..8b3682eaa 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -448,6 +448,11 @@ &:hover { background-position: @but-close-offset-x @but-close-offset-y - 16px; } + + &.disabled { + background-position: @but-close-offset-x @but-close-offset-y - 32px; + cursor: default; + } } } diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 7436675d8..a1299b7fc 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1171,7 +1171,7 @@ define([ this.tblAuthor.on('click', function(e) { var btn = $(e.target); - if (btn.hasClass('close')) { + if (btn.hasClass('close') && !btn.hasClass('disabled')) { var el = btn.closest('tr'), idx = me.tblAuthor.find('tr').index(el); el.remove(); @@ -1333,10 +1333,19 @@ define([ setApi: function(o) { this.api = o; + this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this)); this.updateInfo(this.doc); return this; }, + onLockCore: function(lock) { + this.inputTitle.setDisabled(lock); + this.inputSubject.setDisabled(lock); + this.inputComment.setDisabled(lock); + this.inputAuthor.setDisabled(lock); + this.tblAuthor.find('.close').toggleClass('disabled', lock); + }, + txtPlacement: 'Location', txtOwner: 'Owner', txtUploaded: 'Uploaded', diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index c048950d8..021ce8f9f 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -515,6 +515,11 @@ &:hover { background-position: @but-close-offset-x @but-close-offset-y - 16px; } + + &.disabled { + background-position: @but-close-offset-x @but-close-offset-y - 32px; + cursor: default; + } } }