[DE] Set placeholder when add email/phone forms
This commit is contained in:
parent
7a9b82681a
commit
40c26705a5
|
@ -182,14 +182,19 @@ define([
|
|||
} else if (type == 'combobox' || type == 'dropdown')
|
||||
this.api.asc_AddContentControlList(type == 'combobox', oPr, oFormPr);
|
||||
else if (type == 'text') {
|
||||
var props = new AscCommon.CContentControlPr();
|
||||
oPr = new AscCommon.CSdtTextFormPr();
|
||||
if (options) {
|
||||
if (options.reg)
|
||||
oPr.put_RegExpFormat(options.reg);
|
||||
else if (options.mask)
|
||||
oPr.put_MaskFormat(options.mask);
|
||||
if (options.placeholder)
|
||||
props.put_PlaceholderText(options.placeholder);
|
||||
}
|
||||
this.api.asc_AddContentControlTextForm(oPr, oFormPr);
|
||||
props.put_TextFormPr(oPr);
|
||||
props.put_FormPr(oFormPr);
|
||||
this.api.asc_AddContentControlTextForm(props);
|
||||
} else if (type == 'complex') {
|
||||
this.api.asc_AddComplexForm();
|
||||
}
|
||||
|
|
|
@ -2040,8 +2040,11 @@ define([
|
|||
else if (item.value.indexOf('combobox')>=0 || item.value.indexOf('dropdown')>=0)
|
||||
this.api.asc_AddContentControlList(item.value.indexOf('combobox')>=0, oPr, oFormPr);
|
||||
else if (item.value == 'new-field') {
|
||||
var props = new AscCommon.CContentControlPr();
|
||||
oPr = new AscCommon.CSdtTextFormPr();
|
||||
this.api.asc_AddContentControlTextForm(oPr, oFormPr);
|
||||
props.put_TextFormPr(oPr);
|
||||
props.put_FormPr(oFormPr);
|
||||
this.api.asc_AddContentControlTextForm(props);
|
||||
}
|
||||
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Add Content Control');
|
||||
|
|
|
@ -106,10 +106,10 @@ define([
|
|||
me.fireEvent('forms:insert', ['complex']);
|
||||
});
|
||||
this.btnEmailField && this.btnEmailField.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['text', {reg: "\\S+@\\S+\\.\\S+"}]);
|
||||
me.fireEvent('forms:insert', ['text', {reg: "\\S+@\\S+\\.\\S+", placeholder: 'user_name@email.com'}]);
|
||||
});
|
||||
this.btnPhoneField && this.btnPhoneField.on('click', function (b, e) {
|
||||
me.fireEvent('forms:insert', ['text', {mask: "(999)999-9999"}]);
|
||||
me.fireEvent('forms:insert', ['text', {mask: "(999)999-9999", placeholder: '(999)999-9999'}]);
|
||||
});
|
||||
this.btnViewForm && this.btnViewForm.on('click', function (b, e) {
|
||||
me.fireEvent('forms:mode', [b.pressed]);
|
||||
|
|
Loading…
Reference in a new issue