[DE] Add content controls (picture, checkbox, combobox, dropdown list, date picker)
This commit is contained in:
parent
ad70b9ab15
commit
d2abb4c455
|
@ -750,10 +750,11 @@ define([
|
||||||
(lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
|
(lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
|
||||||
|
|
||||||
if (!paragraph_locked && !header_locked) {
|
if (!paragraph_locked && !header_locked) {
|
||||||
toolbar.btnContentControls.menu.items[0].setDisabled(control_plain || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked);
|
var control_disable = control_plain || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
|
||||||
toolbar.btnContentControls.menu.items[1].setDisabled(control_plain || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked);
|
for (var i=0; i<7; i++)
|
||||||
toolbar.btnContentControls.menu.items[3].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
|
toolbar.btnContentControls.menu.items[i].setDisabled(control_disable);
|
||||||
toolbar.btnContentControls.menu.items[5].setDisabled(!in_control);
|
toolbar.btnContentControls.menu.items[8].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
|
||||||
|
toolbar.btnContentControls.menu.items[10].setDisabled(!in_control);
|
||||||
}
|
}
|
||||||
|
|
||||||
var need_text_disable = paragraph_locked || header_locked || in_chart;
|
var need_text_disable = paragraph_locked || header_locked || in_chart;
|
||||||
|
@ -1745,7 +1746,17 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_AddContentControl(item.value);
|
if (item.value == 'plain' || item.value == 'rich')
|
||||||
|
this.api.asc_AddContentControl((item.value=='plain') ? Asc.c_oAscSdtLevelType.Inline : Asc.c_oAscSdtLevelType.Block);
|
||||||
|
else if (item.value == 'picture')
|
||||||
|
this.api.asc_AddContentControlPicture();
|
||||||
|
else if (item.value == 'checkbox')
|
||||||
|
this.api.asc_AddContentControlCheckBox();
|
||||||
|
else if (item.value == 'date')
|
||||||
|
this.api.asc_AddContentControlDatePicker();
|
||||||
|
else if (item.value == 'combobox' || item.value == 'dropdown')
|
||||||
|
this.api.asc_AddContentControlList(item.value == 'combobox');
|
||||||
|
|
||||||
Common.component.Analytics.trackEvent('ToolBar', 'Add Content Control');
|
Common.component.Analytics.trackEvent('ToolBar', 'Add Content Control');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -631,12 +631,37 @@ define([
|
||||||
{
|
{
|
||||||
caption: this.textPlainControl,
|
caption: this.textPlainControl,
|
||||||
iconCls: 'mnu-control-plain',
|
iconCls: 'mnu-control-plain',
|
||||||
value: Asc.c_oAscSdtLevelType.Inline
|
value: 'plain'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
caption: this.textRichControl,
|
caption: this.textRichControl,
|
||||||
iconCls: 'mnu-control-rich',
|
iconCls: 'mnu-control-rich',
|
||||||
value: Asc.c_oAscSdtLevelType.Block
|
value: 'rich'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: this.textPictureControl,
|
||||||
|
iconCls: 'mnu-control-rich',
|
||||||
|
value: 'picture'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: this.textComboboxControl,
|
||||||
|
iconCls: 'mnu-control-rich',
|
||||||
|
value: 'combobox'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: this.textDropdownControl,
|
||||||
|
iconCls: 'mnu-control-rich',
|
||||||
|
value: 'dropdown'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: this.textDateControl,
|
||||||
|
iconCls: 'mnu-control-rich',
|
||||||
|
value: 'date'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
caption: this.textCheckboxControl,
|
||||||
|
iconCls: 'mnu-control-rich',
|
||||||
|
value: 'checkbox'
|
||||||
},
|
},
|
||||||
{caption: '--'},
|
{caption: '--'},
|
||||||
{
|
{
|
||||||
|
@ -2324,7 +2349,12 @@ define([
|
||||||
capBtnWatermark: 'Watermark',
|
capBtnWatermark: 'Watermark',
|
||||||
textEditWatermark: 'Custom Watermark',
|
textEditWatermark: 'Custom Watermark',
|
||||||
textRemWatermark: 'Remove Watermark',
|
textRemWatermark: 'Remove Watermark',
|
||||||
tipWatermark: 'Edit watermark'
|
tipWatermark: 'Edit watermark',
|
||||||
|
textPictureControl: 'Insert picture content control',
|
||||||
|
textComboboxControl: 'Insert combo box content control',
|
||||||
|
textCheckboxControl: 'Insert check box content control',
|
||||||
|
textDropdownControl: 'Insert drop-down list content control',
|
||||||
|
textDateControl: 'Insert date content control'
|
||||||
}
|
}
|
||||||
})(), DE.Views.Toolbar || {}));
|
})(), DE.Views.Toolbar || {}));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue