|
diff --git a/apps/pdfeditor/main/app/view/FormSettings.js b/apps/pdfeditor/main/app/view/FormSettings.js
index 9ecacd20b7..729835649b 100644
--- a/apps/pdfeditor/main/app/view/FormSettings.js
+++ b/apps/pdfeditor/main/app/view/FormSettings.js
@@ -85,7 +85,8 @@ define([
scope: this
}));
this.PlaceholderSettings = el.find('.form-placeholder');
- this.ListOnlySettings = el.find('.form-list');
+ this.ListSettings = el.find('.form-list-common');
+ this.ListboxOnlySettings = el.find('.form-list');
this.AutofitSettings = el.find('.form-autofit');
this.TextSettings = el.find('.form-text');
this.ComboSettings = el.find('.form-combo');
@@ -277,6 +278,18 @@ define([
dataHintOffset: 'small'
});
this.chCustomText.on('change', this.onChCustomText.bind(this));
+ this.lockedControls.push(this.chCustomText);
+
+ // dropdown list
+ this.chMultisel = new Common.UI.CheckBox({
+ el: $markup.findById('#form-chb-multisel'),
+ labelText: this.textMultisel,
+ dataHint: '1',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.chMultisel.on('change', this.onChMultisel.bind(this));
+ this.lockedControls.push(this.chMultisel);
// combobox & dropdown list
this.txtNewValue = new Common.UI.InputField({
@@ -360,6 +373,16 @@ define([
this.btnListDown.on('click', _.bind(this.onMoveItem, this, false));
this.lockedControls.push(this.btnListDown);
+ this.chCommit = new Common.UI.CheckBox({
+ el: $markup.findById('#form-chb-commit'),
+ labelText: this.textCommit,
+ dataHint: '1',
+ dataHintDirection: 'left',
+ dataHintOffset: 'small'
+ });
+ this.chCommit.on('change', this.onChCommit.bind(this));
+ this.lockedControls.push(this.chCommit);
+
this.UpdateThemeColors();
},
@@ -547,6 +570,20 @@ define([
}
},
+ onChMultisel: function(field, newValue, oldValue, eOpts){
+ if (this.api && !this._noApply) {
+ this.api.SetListboxFieldMultiSelect(field.getValue()=='checked');
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onChCommit: function(field, newValue, oldValue, eOpts){
+ if (this.api && !this._noApply) {
+ this.api.SetListFieldCommitOnSelChange(field.getValue()=='checked');
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
onChMaxCharsChanged: function(field, newValue, oldValue, eOpts){
var checked = (field.getValue()=='checked');
if (this.api && !this._noApply) {
@@ -735,7 +772,14 @@ define([
this.chCustomText.setValue(!!val, true);
this._state.CustomText=val;
}
- this.chCustomText.setDisabled(this._state.DisabledControls);
+ }
+
+ if (type == AscPDF.FIELD_TYPES.listbox && specProps) {
+ val = specProps.asc_getMultipleSelection();
+ if ( this._state.Multisel!==val ) {
+ this.chMultisel.setValue(!!val, true);
+ this._state.Multisel=val;
+ }
}
//for list controls
@@ -766,6 +810,12 @@ define([
this.btnListAdd.setDisabled(true);
this._state.listValue = this._state.listIndex = undefined;
}
+
+ val = specProps.asc_getCommitOnSelChange();
+ if ( this._state.Commit!==val ) {
+ this.chCommit.setValue(!!val, true);
+ this._state.Commit=val;
+ }
}
this.disableListButtons();
}
@@ -891,9 +941,10 @@ define([
isListbox = type === AscPDF.FIELD_TYPES.listbox;
this.PlaceholderSettings.toggleClass('hidden', !(isCombobox || isText));
this.AutofitSettings.toggleClass('hidden', !(isCombobox || isText));
- this.ListOnlySettings.toggleClass('hidden', !(isCombobox || isListbox));
+ this.ListSettings.toggleClass('hidden', !(isCombobox || isListbox));
this.TextSettings.toggleClass('hidden', !isText);
this.ComboSettings.toggleClass('hidden', !isCombobox);
+ this.ListboxOnlySettings.toggleClass('hidden', !isListbox);
}
}, PDFE.Views.FormSettings || {}));
diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json
index c6907c0d2c..8e86891e01 100644
--- a/apps/pdfeditor/main/locale/en.json
+++ b/apps/pdfeditor/main/locale/en.json
@@ -1407,6 +1407,8 @@
"PDFE.Views.FormSettings.textCustomText": "Allow custom text",
"PDFE.Views.FormSettings.textMaxChars": "Characters limit",
"PDFE.Views.FormSettings.textComb": "Comb of characters",
+ "PDFE.Views.FormSettings.textCommit": "Commit selected value immediately",
+ "PDFE.Views.FormSettings.textMultisel": "Multiple selection",
"PDFE.Views.FormsTab.capBtnCheckBox": "Checkbox",
"PDFE.Views.FormsTab.capBtnComboBox": "Combo Box",
"PDFE.Views.FormsTab.capBtnDownloadForm": "Download As PDF",
|