diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 973f47519..b24ce66d3 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -696,7 +696,9 @@ define([ in_equation = false, in_chart = false, layout_index = -1, - no_columns = false; + no_columns = false, + in_smartart = false, + in_smartart_internal = false; while (++i < selectedObjects.length) { type = selectedObjects[i].get_ObjectType(); @@ -731,6 +733,10 @@ define([ || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='straightConnector1') no_columns = true; + if (pr.get_FromSmartArt()) + in_smartart = true; + if (pr.get_FromSmartArtInternal()) + in_smartart_internal = true; } if (type == Asc.c_oAscTypeSelectElement.Image || type == Asc.c_oAscTypeSelectElement.Table) no_columns = true; @@ -798,6 +804,16 @@ define([ else this.toolbar.btnChangeSlide.mnuSlidePicker = {options: {layout_index: layout_index}}; } + + if (this._state.in_smartart !== in_smartart) { + this.toolbar.lockToolbar(PE.enumLock.inSmartart, in_smartart, {array: me.toolbar.paragraphControls}); + this._state.in_smartart = in_smartart; + } + + if (this._state.in_smartart_internal !== in_smartart_internal) { + this.toolbar.lockToolbar(PE.enumLock.inSmartartInternal, in_smartart_internal, {array: me.toolbar.paragraphControls}); + this._state.in_smartart_internal = in_smartart_internal; + } }, onApiStyleChange: function(v) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index ca034b008..c0822a2f3 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -84,7 +84,9 @@ define([ inEquation: 'in-equation', commentLock: 'can-comment', noColumns: 'no-columns', - transitLock: 'transit-lock' + transitLock: 'transit-lock', + inSmartart: 'in-smartart', + inSmartartInternal: 'in-smartart-internal' }; PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){ @@ -376,7 +378,7 @@ define([ enableToggle: true, allowDepress: true, split: true, - lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock], + lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock, _set.inSmartart, _set.inSmartartInternal], menu: new Common.UI.Menu({ style: 'min-width: 100px;', items: [ @@ -453,7 +455,7 @@ define([ id: 'id-toolbar-btn-markers', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-setmarkers', - lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], + lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal], enableToggle: true, toggleGroup: 'markersGroup', split: true, @@ -468,7 +470,7 @@ define([ id: 'id-toolbar-btn-numbering', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-numbering', - lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], + lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal], enableToggle: true, toggleGroup: 'markersGroup', split: true, @@ -595,7 +597,7 @@ define([ id: 'id-toolbar-btn-decoffset', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-decoffset', - lock: [_set.decIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], + lock: [_set.decIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart], dataHint: '1', dataHintDirection: 'top' }); @@ -605,7 +607,7 @@ define([ id: 'id-toolbar-btn-incoffset', cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-incoffset', - lock: [_set.incIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], + lock: [_set.incIndentLock, _set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected, _set.inSmartart], dataHint: '1', dataHintDirection: 'top' });