From ea6479f18c6e8f07af78496c8993b596bba6128e Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 22 Jul 2021 02:09:53 +0300 Subject: [PATCH] start settings --- .../main/app/controller/Main.js | 5 +- .../main/app/controller/Toolbar.js | 4 +- .../main/app/controller/Transitions.js | 62 +++++++++++++++++++ .../main/app/view/Transitions.js | 18 +++--- 4 files changed, 73 insertions(+), 16 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 6779a241b..ab5245c66 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -96,10 +96,7 @@ define([ }, 'Common.Views.ReviewChanges': { 'settings:apply': _.bind(this.applySettings, this) - }/*, - 'Transitions': { - 'settings:apply': _.bind(this.applySettings, this) - }*/ + } }); var me = this, diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 43aa7d163..ce22ba37f 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2400,12 +2400,12 @@ define([ me.toolbar.render(_.extend({compactview: compactview}, config)); - /*var tab = {action: 'review', caption: me.toolbar.textTabCollaboration}; + var tab = {action: 'review', caption: me.toolbar.textTabCollaboration}; var $panel = me.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel(); if ( $panel ) { me.toolbar.addTab(tab, $panel, 3); me.toolbar.setVisible('review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments); - }*/ + } var tab = {action: 'transit', caption: me.toolbar.textTabTransitions}; var $panel = me.getApplication().getController('Transitions').createToolbarPanel(); if ( $panel ) { diff --git a/apps/presentationeditor/main/app/controller/Transitions.js b/apps/presentationeditor/main/app/controller/Transitions.js index b142320f4..c8435ce40 100644 --- a/apps/presentationeditor/main/app/controller/Transitions.js +++ b/apps/presentationeditor/main/app/controller/Transitions.js @@ -189,6 +189,68 @@ define([ this.api.SetSlideProps(props); } + }, + applySettings:functions(props){ + var transition = props.get_transition(); + /*if (transition) { + var value = transition.get_TransitionType(); + var found = false; + if (this._state.Effect !== value) { + var item = this.cmbEffectName.store.findWhere({value: value}); + if (item) { + found = true; + this.cmbEffectName.setValue(item.get('value')); + } else + this.cmbEffectName.setValue(''); + + this.fillEffectTypeCombo((found) ? value : undefined); + this.Effect = value; + this._state.Effect = value; + } + + value = transition.get_TransitionOption(); + if (this._state.EffectType !== value || found) { + found = false; + item = this.cmbEffectType.store.findWhere({value: value}); + if (item) { + found = true; + this.cmbEffectType.setValue(item.get('value')); + } else + this.cmbEffectType.setValue(''); + + this._state.EffectType = value; + } + + value = transition.get_TransitionDuration(); + if ( Math.abs(this._state.Duration-value)>0.001 || + (this._state.Duration===null || value===null)&&(this._state.Duration!==value) || + (this._state.Duration===undefined || value===undefined)&&(this._state.Duration!==value) ) { + this.numDuration.setValue((value !== null && value !== undefined) ? value/1000. : '', true); + this._state.Duration=value; + } + + value = transition.get_SlideAdvanceDuration(); + if ( Math.abs(this._state.Delay-value)>0.001 || + (this._state.Delay===null || value===null)&&(this._state.Delay!==value) || + (this._state.Delay===undefined || value===undefined)&&(this._state.Delay!==value) ) { + this.numDelay.setValue((value !== null && value !== undefined) ? value/1000. : '', true); + this._state.Delay=value; + } + + value = transition.get_SlideAdvanceOnMouseClick(); + if ( this._state.OnMouseClick!==value ) { + this.chStartOnClick.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); + this._state.OnMouseClick=value; + } + value = transition.get_SlideAdvanceAfter(); + if ( this._state.AdvanceAfter!==value ) { + this.chDelay.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); + this.numDelay.setDisabled(this.chDelay.getValue()!=='checked'); + this._state.AdvanceAfter=value; + } + }*/ } + + }, PE.Controllers.Transitions || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/view/Transitions.js b/apps/presentationeditor/main/app/view/Transitions.js index c2e1ebb30..c4917e046 100644 --- a/apps/presentationeditor/main/app/view/Transitions.js +++ b/apps/presentationeditor/main/app/view/Transitions.js @@ -114,6 +114,7 @@ define([ me.btnParametrs.menu.on('item:click', function (menu, item, e) { me.fireEvent('transit:parametrs', [item]); }); + } if(me.btnApplyToAll) { @@ -374,7 +375,6 @@ define([ }, setMenuParametrs:function (effect) { - var minMax=[0,0]; switch (effect) { case Asc.c_oAscSlideTransitionTypes.Fade: @@ -402,19 +402,17 @@ define([ minMax=[17,17]; break; } - var i + //this.btnParametrs.menu.clearAll(); + _.each(this.btnParametrs.menu.items,function (element,index){ - if((indexminMax[1])) - element.$el.css('display','none'); - else - element.$el.css('display',''); - - + element.$el.css('display',((indexminMax[1]))?'none':''); }); - - + if(effect!=Asc.c_oAscSlideTransitionTypes.None) + { + this.btnParametrs.menu.items[minMax[0]].$el.click(); + } },