[PE][SSE] Lock document info settings

This commit is contained in:
Julia Radzhabova 2019-06-21 15:19:56 +03:00
parent d7abed8f38
commit e07a6caca4
4 changed files with 30 additions and 2 deletions

View file

@ -720,7 +720,7 @@ define([
this.tblAuthor.on('click', function(e) { this.tblAuthor.on('click', function(e) {
var btn = $(e.target); var btn = $(e.target);
if (btn.hasClass('close')) { if (btn.hasClass('close') && !btn.hasClass('disabled')) {
var el = btn.closest('tr'), var el = btn.closest('tr'),
idx = me.tblAuthor.find('tr').index(el); idx = me.tblAuthor.find('tr').index(el);
el.remove(); el.remove();
@ -882,10 +882,19 @@ define([
setApi: function(o) { setApi: function(o) {
this.api = o; this.api = o;
this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this));
this.updateInfo(this.doc); this.updateInfo(this.doc);
return this; 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', txtPlacement: 'Location',
txtOwner: 'Owner', txtOwner: 'Owner',
txtUploaded: 'Uploaded', txtUploaded: 'Uploaded',

View file

@ -448,6 +448,11 @@
&:hover { &:hover {
background-position: @but-close-offset-x @but-close-offset-y - 16px; 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;
}
} }
} }

View file

@ -1171,7 +1171,7 @@ define([
this.tblAuthor.on('click', function(e) { this.tblAuthor.on('click', function(e) {
var btn = $(e.target); var btn = $(e.target);
if (btn.hasClass('close')) { if (btn.hasClass('close') && !btn.hasClass('disabled')) {
var el = btn.closest('tr'), var el = btn.closest('tr'),
idx = me.tblAuthor.find('tr').index(el); idx = me.tblAuthor.find('tr').index(el);
el.remove(); el.remove();
@ -1333,10 +1333,19 @@ define([
setApi: function(o) { setApi: function(o) {
this.api = o; this.api = o;
this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this));
this.updateInfo(this.doc); this.updateInfo(this.doc);
return this; 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', txtPlacement: 'Location',
txtOwner: 'Owner', txtOwner: 'Owner',
txtUploaded: 'Uploaded', txtUploaded: 'Uploaded',

View file

@ -515,6 +515,11 @@
&:hover { &:hover {
background-position: @but-close-offset-x @but-close-offset-y - 16px; 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;
}
} }
} }