[SSE] Lock text editing in the toolbar when shape/chart is selected and locked
This commit is contained in:
parent
24e1663035
commit
0fe19076ee
|
@ -147,7 +147,6 @@ define([
|
||||||
|
|
||||||
for (i=0; i<SelectedObjects.length; ++i)
|
for (i=0; i<SelectedObjects.length; ++i)
|
||||||
{
|
{
|
||||||
var type = SelectedObjects[i].asc_getObjectType();
|
|
||||||
var eltype = SelectedObjects[i].asc_getObjectType(),
|
var eltype = SelectedObjects[i].asc_getObjectType(),
|
||||||
settingsType = this.getDocumentSettingsType(eltype);
|
settingsType = this.getDocumentSettingsType(eltype);
|
||||||
if (settingsType===undefined || settingsType>=this._settings.length || this._settings[settingsType]===undefined)
|
if (settingsType===undefined || settingsType>=this._settings.length || this._settings[settingsType]===undefined)
|
||||||
|
|
|
@ -2345,7 +2345,6 @@ define([
|
||||||
_disableEditOptions: function(seltype, coauth_disable) {
|
_disableEditOptions: function(seltype, coauth_disable) {
|
||||||
if (this.api.isCellEdited) return true;
|
if (this.api.isCellEdited) return true;
|
||||||
if (this.api.isRangeSelection) return true;
|
if (this.api.isRangeSelection) return true;
|
||||||
if (this._state.selection_type===seltype && this._state.coauthdisable===coauth_disable) return (seltype===Asc.c_oAscSelectionType.RangeImage);
|
|
||||||
|
|
||||||
var toolbar = this.toolbar,
|
var toolbar = this.toolbar,
|
||||||
is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
|
is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
|
||||||
|
@ -2353,7 +2352,19 @@ define([
|
||||||
is_shape_text = seltype == Asc.c_oAscSelectionType.RangeShapeText,
|
is_shape_text = seltype == Asc.c_oAscSelectionType.RangeShapeText,
|
||||||
is_shape = seltype == Asc.c_oAscSelectionType.RangeShape,
|
is_shape = seltype == Asc.c_oAscSelectionType.RangeShape,
|
||||||
is_image = seltype == Asc.c_oAscSelectionType.RangeImage,
|
is_image = seltype == Asc.c_oAscSelectionType.RangeImage,
|
||||||
is_mode_2 = is_shape_text || is_shape || is_chart_text || is_chart;
|
is_mode_2 = is_shape_text || is_shape || is_chart_text || is_chart,
|
||||||
|
is_objLocked = false;
|
||||||
|
|
||||||
|
if (!(is_mode_2 || is_image) && this._state.selection_type===seltype && this._state.coauthdisable===coauth_disable) return (seltype===Asc.c_oAscSelectionType.RangeImage);
|
||||||
|
|
||||||
|
if (is_mode_2) {
|
||||||
|
var SelectedObjects = this.api.asc_getGraphicObjectProps();
|
||||||
|
for (var i=0; i<SelectedObjects.length; ++i)
|
||||||
|
{
|
||||||
|
if (SelectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image)
|
||||||
|
is_objLocked = is_objLocked || SelectedObjects[i].asc_getObjectValue().asc_getLocked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( coauth_disable ) {
|
if ( coauth_disable ) {
|
||||||
toolbar.lockToolbar(SSE.enumLock.coAuth, coauth_disable);
|
toolbar.lockToolbar(SSE.enumLock.coAuth, coauth_disable);
|
||||||
|
@ -2382,6 +2393,7 @@ define([
|
||||||
merge: true,
|
merge: true,
|
||||||
clear: [_set.selImage, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.coAuth]
|
clear: [_set.selImage, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.coAuth]
|
||||||
});
|
});
|
||||||
|
toolbar.lockToolbar(SSE.enumLock.coAuthText, is_objLocked);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#ce-func-label').toggleClass('disabled', is_image || is_mode_2 || coauth_disable);
|
$('#ce-func-label').toggleClass('disabled', is_image || is_mode_2 || coauth_disable);
|
||||||
|
|
|
@ -71,6 +71,7 @@ define([
|
||||||
selRange: 'sel-range',
|
selRange: 'sel-range',
|
||||||
lostConnect: 'disconnect',
|
lostConnect: 'disconnect',
|
||||||
coAuth: 'co-auth',
|
coAuth: 'co-auth',
|
||||||
|
coAuthText: 'co-auth-text',
|
||||||
ruleMerge: 'rule-btn-merge',
|
ruleMerge: 'rule-btn-merge',
|
||||||
ruleFilter: 'rule-filter',
|
ruleFilter: 'rule-filter',
|
||||||
ruleDelFilter: 'rule-clear-filter',
|
ruleDelFilter: 'rule-clear-filter',
|
||||||
|
@ -149,7 +150,7 @@ define([
|
||||||
cls : 'input-group-nr',
|
cls : 'input-group-nr',
|
||||||
menuStyle : 'min-width: 55px;',
|
menuStyle : 'min-width: 55px;',
|
||||||
hint : me.tipFontSize,
|
hint : me.tipFontSize,
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
data : [
|
data : [
|
||||||
{ value: 8, displayValue: "8" },
|
{ value: 8, displayValue: "8" },
|
||||||
{ value: 9, displayValue: "9" },
|
{ value: 9, displayValue: "9" },
|
||||||
|
@ -189,7 +190,7 @@ define([
|
||||||
menuCls : 'scrollable-menu',
|
menuCls : 'scrollable-menu',
|
||||||
menuStyle : 'min-width: 325px;',
|
menuStyle : 'min-width: 325px;',
|
||||||
hint : me.tipFontName,
|
hint : me.tipFontName,
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
store : new Common.Collections.Fonts()
|
store : new Common.Collections.Fonts()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -239,21 +240,21 @@ define([
|
||||||
id : 'id-toolbar-btn-incfont',
|
id : 'id-toolbar-btn-incfont',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-incfont',
|
iconCls : 'btn-incfont',
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect]
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect]
|
||||||
});
|
});
|
||||||
|
|
||||||
me.btnDecFontSize = new Common.UI.Button({
|
me.btnDecFontSize = new Common.UI.Button({
|
||||||
id : 'id-toolbar-btn-decfont',
|
id : 'id-toolbar-btn-decfont',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-decfont',
|
iconCls : 'btn-decfont',
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect]
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect]
|
||||||
});
|
});
|
||||||
|
|
||||||
me.btnBold = new Common.UI.Button({
|
me.btnBold = new Common.UI.Button({
|
||||||
id : 'id-toolbar-btn-bold',
|
id : 'id-toolbar-btn-bold',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-bold',
|
iconCls : 'btn-bold',
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
enableToggle: true
|
enableToggle: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -261,7 +262,7 @@ define([
|
||||||
id : 'id-toolbar-btn-italic',
|
id : 'id-toolbar-btn-italic',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-italic',
|
iconCls : 'btn-italic',
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
enableToggle: true
|
enableToggle: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -269,7 +270,7 @@ define([
|
||||||
id : 'id-toolbar-btn-underline',
|
id : 'id-toolbar-btn-underline',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-underline',
|
iconCls : 'btn-underline',
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
enableToggle: true
|
enableToggle: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -279,7 +280,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-fontcolor',
|
iconCls : 'btn-fontcolor',
|
||||||
split : true,
|
split : true,
|
||||||
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{ template: _.template('<div id="id-toolbar-menu-fontcolor" style="width: 165px; height: 220px; margin: 10px;"></div>') },
|
{ template: _.template('<div id="id-toolbar-menu-fontcolor" style="width: 165px; height: 220px; margin: 10px;"></div>') },
|
||||||
|
@ -302,7 +303,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-fillparag',
|
iconCls : 'btn-fillparag',
|
||||||
split : true,
|
split : true,
|
||||||
lock : [_set.selImage, _set.editCell, _set.coAuth, _set.lostConnect],
|
lock : [_set.selImage, _set.editCell, _set.coAuth, _set.coAuthText, _set.lostConnect],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{ template: _.template('<div id="id-toolbar-menu-paracolor" style="width: 165px; height: 220px; margin: 10px;"></div>') },
|
{ template: _.template('<div id="id-toolbar-menu-paracolor" style="width: 165px; height: 220px; margin: 10px;"></div>') },
|
||||||
|
@ -337,7 +338,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-align-left',
|
iconCls : 'btn-align-left',
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
toggleGroup : 'alignGroup'
|
toggleGroup : 'alignGroup'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -346,7 +347,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-align-center',
|
iconCls : 'btn-align-center',
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
toggleGroup : 'alignGroup'
|
toggleGroup : 'alignGroup'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -355,7 +356,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-align-right',
|
iconCls : 'btn-align-right',
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
toggleGroup : 'alignGroup'
|
toggleGroup : 'alignGroup'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -364,7 +365,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-align-just',
|
iconCls : 'btn-align-just',
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
toggleGroup: 'alignGroup'
|
toggleGroup: 'alignGroup'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -402,7 +403,7 @@ define([
|
||||||
id : 'id-toolbar-rtn-valign-top',
|
id : 'id-toolbar-rtn-valign-top',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-valign-top',
|
iconCls : 'btn-valign-top',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
toggleGroup : 'vAlignGroup'
|
toggleGroup : 'vAlignGroup'
|
||||||
});
|
});
|
||||||
|
@ -412,7 +413,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-valign-middle',
|
iconCls : 'btn-valign-middle',
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
toggleGroup : 'vAlignGroup'
|
toggleGroup : 'vAlignGroup'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -420,7 +421,7 @@ define([
|
||||||
id : 'id-toolbar-rtn-valign-bottom',
|
id : 'id-toolbar-rtn-valign-bottom',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-valign-bottom',
|
iconCls : 'btn-valign-bottom',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
toggleGroup : 'vAlignGroup'
|
toggleGroup : 'vAlignGroup'
|
||||||
});
|
});
|
||||||
|
@ -438,7 +439,7 @@ define([
|
||||||
id : 'id-toolbar-rtn-textorient',
|
id : 'id-toolbar-rtn-textorient',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-text-orient',
|
iconCls : 'btn-text-orient',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
@ -961,7 +962,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-align-left',
|
iconCls : 'btn-align-left',
|
||||||
icls : 'btn-align-left',
|
icls : 'btn-align-left',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
@ -1010,7 +1011,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-valign-bottom',
|
iconCls : 'btn-valign-bottom',
|
||||||
icls : 'btn-valign-bottom',
|
icls : 'btn-valign-bottom',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.lostConnect, _set.coAuth, _set.coAuthText],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue