mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-26 11:58:11 +08:00
[PDF] Add readonly form option
This commit is contained in:
@ -291,6 +291,11 @@
|
||||
<div id="form-chb-required"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small">
|
||||
<div id="form-chb-readonly"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-text-combo">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
|
||||
@ -136,6 +136,16 @@ define([
|
||||
this.chRequired.on('change', this.onChRequired.bind(this));
|
||||
this.lockedControls.push(this.chRequired);
|
||||
|
||||
this.chReadonly = new Common.UI.CheckBox({
|
||||
el: $markup.findById('#form-chb-readonly'),
|
||||
labelText: this.textReadonly,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'left',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.chReadonly.on('change', this.onChReadonly.bind(this));
|
||||
this.lockedControls.push(this.chReadonly);
|
||||
|
||||
this.cmbLineWidth = new Common.UI.ComboBox({
|
||||
el: $markup.findById('#form-combo-line-width'),
|
||||
cls: 'input-group-nr',
|
||||
@ -770,6 +780,13 @@ define([
|
||||
}
|
||||
},
|
||||
|
||||
onChReadonly: function(field, newValue, oldValue, eOpts){
|
||||
if (this.api && !this._noApply) {
|
||||
this.api.SetFieldReadOnly(field.getValue()==='checked');
|
||||
this.fireEvent('editcomplete', this);
|
||||
}
|
||||
},
|
||||
|
||||
onColorBGSelect: function(btn, color) {
|
||||
this.BackgroundColor = color;
|
||||
this._state.BackgroundColor = undefined;
|
||||
@ -1247,6 +1264,12 @@ define([
|
||||
this._state.Required=val;
|
||||
}
|
||||
|
||||
val = props.asc_getReadOnly();
|
||||
if ( this._state.Readonly!==val ) {
|
||||
this.chReadonly.setValue(!!val, true);
|
||||
this._state.Readonly=val;
|
||||
}
|
||||
|
||||
var color = props.asc_getStroke();
|
||||
if (color) {
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
|
||||
@ -1416,6 +1416,7 @@
|
||||
"PDFE.Views.FormSettings.textColor": "Color",
|
||||
"PDFE.Views.FormSettings.textBackgroundColor": "Background color",
|
||||
"PDFE.Views.FormSettings.textRequired": "Required",
|
||||
"PDFE.Views.FormSettings.textReadonly": "Read only",
|
||||
"PDFE.Views.FormSettings.textNoBorder": "No border",
|
||||
"PDFE.Views.FormSettings.textNoFill": "No fill",
|
||||
"PDFE.Views.FormSettings.textThin": "Thin",
|
||||
|
||||
Reference in New Issue
Block a user