[PE] Fix lock animation tab. Fix fill settings/change effects.
This commit is contained in:
parent
01cf4e1eb3
commit
39d99bc762
|
@ -815,11 +815,10 @@ define(function(){ 'use strict';
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_ZOOM, iconCls: 'transition-zoom', displayValue: this.textZoom},
|
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_ZOOM, iconCls: 'transition-zoom', displayValue: this.textZoom},
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_SWIVEL, iconCls: 'transition-push', displayValue: this.textSwivel},
|
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_SWIVEL, iconCls: 'transition-push', displayValue: this.textSwivel},
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_BOUNCE, iconCls: 'transition-push', displayValue: this.textBounce},
|
{group: 'menu-effect-group-entrance', value: AscFormat.ENTRANCE_BOUNCE, iconCls: 'transition-push', displayValue: this.textBounce},
|
||||||
{group: 'menu-effect-group-entrance', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'transition-push', displayValue: this.textFillColor, isHide: true},
|
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_PULSE, iconCls: 'transition-push', displayValue: this.textPulse},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_PULSE, iconCls: 'transition-push', displayValue: this.textPulse},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_COLOR_PULSE, iconCls: 'transition-push', displayValue: this.textColorPulse},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_COLOR_PULSE, iconCls: 'transition-push', displayValue: this.textColorPulse},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_TEETER, iconCls: 'transition-push', displayValue: this.textTeeter},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_TEETER, iconCls: 'transition-push', displayValue: this.textTeeter},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_SPIN, iconCls: 'transition-split', displayValue: this.textSplit},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_SPIN, iconCls: 'transition-split', displayValue: this.textSpin},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_GROW_SHRINK, iconCls: 'transition-push', displayValue: this.textGrowShrink},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_GROW_SHRINK, iconCls: 'transition-push', displayValue: this.textGrowShrink},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_DESATURATE, iconCls: 'transition-push', displayValue: this.textDesaturate},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_DESATURATE, iconCls: 'transition-push', displayValue: this.textDesaturate},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_CONTRASTING_DARKEN, iconCls: 'transition-push', displayValue: this.textDarken},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_CONTRASTING_DARKEN, iconCls: 'transition-push', displayValue: this.textDarken},
|
||||||
|
@ -829,7 +828,6 @@ define(function(){ 'use strict';
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_COMPLEMENTARY_COLOR, iconCls: 'transition-push', displayValue: this.textComplementaryColor},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_COMPLEMENTARY_COLOR, iconCls: 'transition-push', displayValue: this.textComplementaryColor},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_LINE_COLOR, iconCls: 'transition-push', displayValue: this.textLineColor},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_LINE_COLOR, iconCls: 'transition-push', displayValue: this.textLineColor},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_FILL_COLOR, iconCls: 'transition-push', displayValue: this.textFillColor},
|
{group: 'menu-effect-group-emphasis', value: AscFormat.EMPHASIS_FILL_COLOR, iconCls: 'transition-push', displayValue: this.textFillColor},
|
||||||
{group: 'menu-effect-group-emphasis', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'transition-push', displayValue: this.textFillColor, isHide: true},
|
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_DISAPPEAR, iconCls: 'transition-push', displayValue: this.textDisappear},
|
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_DISAPPEAR, iconCls: 'transition-push', displayValue: this.textDisappear},
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FADE, iconCls: 'transition-push', displayValue: this.textFade},
|
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FADE, iconCls: 'transition-push', displayValue: this.textFade},
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FLY_OUT_TO, iconCls: 'transition-push', displayValue: this.textFlyOut},
|
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_FLY_OUT_TO, iconCls: 'transition-push', displayValue: this.textFlyOut},
|
||||||
|
@ -846,7 +844,6 @@ define(function(){ 'use strict';
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_ZOOM, iconCls: 'transition-push', displayValue: this.textZoom},
|
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_ZOOM, iconCls: 'transition-push', displayValue: this.textZoom},
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_BASIC_SWIVEL, iconCls: 'transition-push', displayValue: this.textSwivel},
|
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_BASIC_SWIVEL, iconCls: 'transition-push', displayValue: this.textSwivel},
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_BOUNCE, iconCls: 'transition-push', displayValue: this.textBounce},
|
{group: 'menu-effect-group-exit', value: AscFormat.EXIT_BOUNCE, iconCls: 'transition-push', displayValue: this.textBounce},
|
||||||
{group: 'menu-effect-group-exit', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'transition-push', displayValue: this.textFillColor, isHide: true},
|
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_DOWN, iconCls: 'transition-push', displayValue: this.textDown},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_DOWN, iconCls: 'transition-push', displayValue: this.textDown},
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LEFT, iconCls: 'transition-push', displayValue: this.textLeft},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LEFT, iconCls: 'transition-push', displayValue: this.textLeft},
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_RIGHT, iconCls: 'transition-push', displayValue: this.textRight},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_RIGHT, iconCls: 'transition-push', displayValue: this.textRight},
|
||||||
|
@ -872,9 +869,7 @@ define(function(){ 'use strict';
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'transition-push', displayValue: this.textHorizontalFigure},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'transition-push', displayValue: this.textHorizontalFigure},
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_VERTICAL_FIGURE_8, iconCls: 'transition-push', displayValue: this.textVerticalFigure},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_VERTICAL_FIGURE_8, iconCls: 'transition-push', displayValue: this.textVerticalFigure},
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LOOP_DE_LOOP, iconCls: 'transition-push', displayValue: this.textLoopDeLoop},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LOOP_DE_LOOP, iconCls: 'transition-push', displayValue: this.textLoopDeLoop},
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'transition-push', displayValue: this.textCustomPath},
|
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'transition-push', displayValue: this.textCustomPath}
|
||||||
{group: 'menu-effect-group-path', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'transition-push', displayValue: this.textFillColor, isHide: true}
|
|
||||||
|
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onParameterClick: function (value) {
|
onParameterClick: function (value) {
|
||||||
this._state.EffectOption = value;
|
// this._state.EffectOption = value;
|
||||||
if(this.api && this.AnimationProperties) {
|
if(this.api && this.AnimationProperties) {
|
||||||
this.AnimationProperties.asc_putSubtype(value);
|
this.AnimationProperties.asc_putSubtype(value);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
|
@ -133,10 +133,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onAnimationPane: function() {
|
onAnimationPane: function() {
|
||||||
(new PE.Views.AnimationDialog({
|
|
||||||
api : this.api,
|
|
||||||
activeEffect : this._state.Effect
|
|
||||||
})).show();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onAnimationAdditional: function(replace) { // replace or add new additional effect
|
onAnimationAdditional: function(replace) { // replace or add new additional effect
|
||||||
|
@ -170,24 +166,24 @@ define([
|
||||||
|
|
||||||
onDurationChange: function(field, newValue, oldValue, eOpts) {
|
onDurationChange: function(field, newValue, oldValue, eOpts) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
this._state.Duration = field.getNumberValue() * 1000;
|
// this._state.Duration = field.getNumberValue() * 1000;
|
||||||
this.AnimationProperties.asc_putDuration(this._state.Duration);
|
this.AnimationProperties.asc_putDuration(field.getNumberValue() * 1000);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDelayChange: function(field, newValue, oldValue, eOpts) {
|
onDelayChange: function(field, newValue, oldValue, eOpts) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
this._state.Delay = field.getNumberValue() * 1000;
|
// this._state.Delay = field.getNumberValue() * 1000;
|
||||||
this.AnimationProperties.asc_putDelay(this._state.Delay);
|
this.AnimationProperties.asc_putDelay(field.getNumberValue() * 1000);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onRepeatChange: function (field, newValue, oldValue, eOpts){
|
onRepeatChange: function (field, newValue, oldValue, eOpts){
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
this._state.Repeat = field.getNumberValue() * 1000;
|
// this._state.Repeat = field.getNumberValue() * 1000;
|
||||||
this.AnimationProperties.asc_putRepeatCount(this._state.Repeat);
|
this.AnimationProperties.asc_putRepeatCount(field.getNumberValue() * 1000);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -208,10 +204,10 @@ define([
|
||||||
{
|
{
|
||||||
if(this.api)
|
if(this.api)
|
||||||
{
|
{
|
||||||
this._state.Trigger = this.view.triggers.ClickOf;
|
// this._state.Trigger = this.view.triggers.ClickOf;
|
||||||
this._state.TriggerValue = value.caption;
|
// this._state.TriggerValue = value.caption;
|
||||||
this.AnimationProperties.asc_putTriggerClickSequence(false);
|
this.AnimationProperties.asc_putTriggerClickSequence(false);
|
||||||
this.AnimationProperties.asc_putTriggerObjectClick(this._state.TriggerValue);
|
this.AnimationProperties.asc_putTriggerObjectClick(value.caption);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,8 +223,8 @@ define([
|
||||||
|
|
||||||
onStartSelect: function (combo, record) {
|
onStartSelect: function (combo, record) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
this._state.StartEffect = record.value;
|
// this._state.StartEffect = record.value;
|
||||||
this.AnimationProperties.asc_putStartType(this._state.StartEffect);
|
this.AnimationProperties.asc_putStartType(record.value);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -241,109 +237,148 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onFocusObject: function(selectedObjects) {
|
onFocusObject: function(selectedObjects) {
|
||||||
var isAnimtionObject = false, isAnimation = false;
|
this.AnimationProperties = null;
|
||||||
for (var i = 0; i<selectedObjects.length; i++) {
|
for (var i = 0; i<selectedObjects.length; i++) {
|
||||||
var eltype = selectedObjects[i].get_ObjectType();
|
if (selectedObjects[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Animation) {
|
||||||
|
|
||||||
if (eltype === undefined)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (eltype == Asc.c_oAscTypeSelectElement.Animation) {
|
|
||||||
this.AnimationProperties = selectedObjects[i].get_ObjectValue();
|
this.AnimationProperties = selectedObjects[i].get_ObjectValue();
|
||||||
|
|
||||||
this.loadSettings(this.AnimationProperties);
|
|
||||||
if (this._state.onactivetab) {
|
|
||||||
this.setLocked();
|
|
||||||
this.setSettings();
|
|
||||||
isAnimation = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if((eltype == Asc.c_oAscTypeSelectElement.Shape) ||
|
|
||||||
(eltype == Asc.c_oAscTypeSelectElement.Tab) ||
|
|
||||||
(eltype == Asc.c_oAscTypeSelectElement.Text) ||
|
|
||||||
(eltype == Asc.c_oAscTypeSelectElement.Image)) {
|
|
||||||
isAnimtionObject = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setLockedByObjects (isAnimtionObject, isAnimation);
|
if (this._state.onactivetab)
|
||||||
|
this.setSettings();
|
||||||
},
|
},
|
||||||
|
|
||||||
setLockedByObjects: function (isAnimtionObject, isAnimation) {
|
setSettings: function () {
|
||||||
if(isAnimtionObject)
|
this._state.noGraphic = this._state.noAnimation = this._state.noAnimationParam = this._state.noTriggerObjects = true;
|
||||||
{
|
if (this.AnimationProperties) {
|
||||||
if(isAnimation) {
|
this._state.noGraphic = false;
|
||||||
if (this._state.Effect == AscFormat.ANIM_PRESET_NONE) {
|
|
||||||
this.view.setDisabled(true);
|
|
||||||
this.view.listEffects.setDisabled(false);
|
|
||||||
|
|
||||||
this.view.effectId = AscFormat.ANIM_PRESET_NONE;
|
var item,
|
||||||
|
view = this.view,
|
||||||
|
store = view.listEffects.store,
|
||||||
|
fieldStore = view.listEffects.fieldPicker.store,
|
||||||
|
value = this.AnimationProperties.asc_getType(),
|
||||||
|
group = this.AnimationProperties.asc_getClass();
|
||||||
|
|
||||||
|
(value == undefined) && (value = AscFormat.ANIM_PRESET_NONE);
|
||||||
|
this._state.noAnimation = (value===AscFormat.ANIM_PRESET_NONE);
|
||||||
|
|
||||||
|
if (this._state.Effect !== value || this._state.EffectGroup !== group) {
|
||||||
|
this._state.Effect = value;
|
||||||
|
this._state.EffectGroup = group;
|
||||||
|
|
||||||
|
group = view.listEffects.groups.findWhere({value: this._state.EffectGroup});
|
||||||
|
item = store.findWhere(group ? {group: group.get('id'), value: this._state.Effect} : {value: this._state.Effect});
|
||||||
|
if (item) {
|
||||||
|
var forceFill = false;
|
||||||
|
if (!item.get('isCustom')) { // remove custom effect from list if not-custom is selected
|
||||||
|
var rec = store.findWhere({isCustom: true});
|
||||||
|
forceFill = !!rec;
|
||||||
|
store.remove(rec);
|
||||||
|
}
|
||||||
|
if (this._state.Effect!==AscFormat.ANIM_PRESET_MULTIPLE) { // remove "multiple" item if one effect is selected
|
||||||
|
var rec = fieldStore.findWhere({value: AscFormat.ANIM_PRESET_MULTIPLE});
|
||||||
|
forceFill = forceFill || !!rec;
|
||||||
|
fieldStore.remove(rec);
|
||||||
|
}
|
||||||
|
view.listEffects.selectRecord(item);
|
||||||
|
view.listEffects.fillComboView(item, true, forceFill);
|
||||||
|
view.btnParameters.setIconCls('toolbar__icon icon ' + item.get('iconCls'));
|
||||||
} else {
|
} else {
|
||||||
this.view.setDisabled(false);
|
if (this._state.Effect==AscFormat.ANIM_PRESET_MULTIPLE) { // add and select "multiple" item
|
||||||
this.view.btnParameters.setDisabled(this.view.btnParameters.menu.items.length == 0)
|
view.listEffects.fillComboView(store.at(0), false, true);
|
||||||
|
fieldStore.remove(fieldStore.at(fieldStore.length-1));
|
||||||
|
view.listEffects.fieldPicker.selectRecord(fieldStore.add(new Common.UI.DataViewModel({
|
||||||
|
group: 'none',
|
||||||
|
value: AscFormat.ANIM_PRESET_MULTIPLE,
|
||||||
|
iconCls: 'transition-multiple',
|
||||||
|
displayValue: view.textMultiple
|
||||||
|
}), {at:1}));
|
||||||
|
view.listEffects.menuPicker.deselectAll();
|
||||||
|
} else { // add custom effect to appropriate group
|
||||||
|
if (group) {
|
||||||
|
store.remove(store.findWhere({isCustom: true})); // remove other custom effects
|
||||||
|
|
||||||
|
var items = store.where({group: group.get('id')});
|
||||||
|
var index = (items && items.length>0) ? store.indexOf(items.at(items.length-1)) : store.length-1;
|
||||||
|
var rec = _.findWhere(Common.define.effectData.getEffectFullData(), {group: group.get('id'), value: this._state.Effect});
|
||||||
|
item = store.add(new Common.UI.DataViewModel({
|
||||||
|
group: group.get('id'),
|
||||||
|
value: this._state.Effect,
|
||||||
|
iconCls: 'transition-push',
|
||||||
|
displayValue: rec ? rec.displayValue : '',
|
||||||
|
isCustom: true
|
||||||
|
}), {at:index+1});
|
||||||
|
view.listEffects.selectRecord(item);
|
||||||
|
view.listEffects.fillComboView(item, true, true);
|
||||||
|
view.btnParameters.setIconCls('toolbar__icon icon ' + item.get('iconCls'));
|
||||||
|
} else {
|
||||||
|
view.listEffects.fieldPicker.deselectAll();
|
||||||
|
view.listEffects.menuPicker.deselectAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
this.view.setDisabled(true);
|
|
||||||
this.view.listEffects.setDisabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
this.view.setDisabled(true);
|
|
||||||
|
|
||||||
this.view.btnAddAnimation.setDisabled(this.view.listEffects.isDisabled());
|
this._state.EffectOption = this.AnimationProperties.asc_getSubtype();
|
||||||
|
if (this._state.EffectOption !== undefined)
|
||||||
|
this._state.noAnimationParam = view.setMenuParameters(this._state.Effect, this._state.EffectOption)===undefined;
|
||||||
|
|
||||||
|
value = this.AnimationProperties.asc_getDuration();
|
||||||
|
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._state.Duration = value;
|
||||||
|
view.numDuration.setValue((this._state.Duration !== null && this._state.Duration !== undefined) ? this._state.Duration / 1000. : '', true);
|
||||||
|
}
|
||||||
|
value = this.AnimationProperties.asc_getDelay();
|
||||||
|
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._state.Delay = value;
|
||||||
|
view.numDelay.setValue((this._state.Delay !== null && this._state.Delay !== undefined) ? this._state.Delay / 1000. : '', true);
|
||||||
|
}
|
||||||
|
value = this.AnimationProperties.asc_getRepeatCount();
|
||||||
|
if (Math.abs(this._state.Repeat - value) > 0.001 ||
|
||||||
|
(this._state.Repeat === null || value === null) && (this._state.Repeat !== value) ||
|
||||||
|
(this._state.Repeat === undefined || value === undefined) && (this._state.Repeat !== value)) {
|
||||||
|
this._state.Repeat = value;
|
||||||
|
view.numRepeat.setValue((this._state.Repeat !== null && this._state.Repeat !== undefined) ? this._state.Repeat / 1000. : '', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._state.StartSelect = this.AnimationProperties.asc_getStartType();
|
||||||
|
view.cmbStart.setValue(this._state.StartSelect!==undefined ? this._state.StartSelect : AscFormat.NODE_TYPE_CLICKEFFECT);
|
||||||
|
|
||||||
|
this._state.Rewind = this.AnimationProperties.asc_getRewind();
|
||||||
|
view.chRewind.setValue(!!this._state.Rewind, true);
|
||||||
|
|
||||||
|
if(this.AnimationProperties.asc_getTriggerClickSequence()) {
|
||||||
|
this._state.trigger = view.triggers.ClickSequence;
|
||||||
|
this._state.TriggerValue = true;
|
||||||
|
} else {
|
||||||
|
this._state.trigger = view.triggers.ClickOf;
|
||||||
|
this._state.TriggerValue = this.AnimationProperties.asc_getTriggerObjectClick();
|
||||||
|
}
|
||||||
|
this.setTriggerList();
|
||||||
|
}
|
||||||
|
this.setLocked();
|
||||||
},
|
},
|
||||||
|
|
||||||
loadSettings: function (props) {
|
setTriggerList: function (){
|
||||||
this.AnimationProperties = props;
|
var me = this;
|
||||||
var value;
|
this.objectNames = this.api.asc_getCurSlideObjectsNames();
|
||||||
this._state.EffectGroup = this.AnimationProperties.asc_getClass();
|
this._state.noTriggerObjects = !this.objectNames || this.objectNames.length<1;
|
||||||
value = this.AnimationProperties.asc_getType();
|
|
||||||
(value == undefined) && (value = AscFormat.ANIM_PRESET_NONE);
|
|
||||||
this._state.EffectOption = this.AnimationProperties.asc_getSubtype();
|
|
||||||
this._state.Effect = value;
|
|
||||||
|
|
||||||
value = this.AnimationProperties.asc_getDuration();
|
this.view.btnClickOf.menu.removeAll();
|
||||||
if (Math.abs(this._state.Duration - value) > 0.001 ||
|
var btnMemnu=this.view.btnClickOf.menu;
|
||||||
(this._state.Duration === null || value === null) && (this._state.Duration !== value) ||
|
this.objectNames.forEach(function (item){
|
||||||
(this._state.Duration === undefined || value === undefined) && (this._state.Duration !== value)) {
|
btnMemnu.addItem({ caption: item, checkable: true, toggleGroup: 'animtrigger', checked: item===me._state.TriggerValue});
|
||||||
this._state.Duration = value;
|
});
|
||||||
}
|
this.view.cmbTrigger.menu.items[0].setChecked(this._state.trigger == this.view.triggers.ClickSequence);
|
||||||
|
|
||||||
value = this.AnimationProperties.asc_getDelay();
|
|
||||||
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._state.Delay = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = this.AnimationProperties.asc_getRepeatCount();
|
|
||||||
if (Math.abs(this._state.Repeat - value) > 0.001 ||
|
|
||||||
(this._state.Repeat === null || value === null) && (this._state.Repeat !== value) ||
|
|
||||||
(this._state.Repeat === undefined || value === undefined) && (this._state.Repeat !== value)) {
|
|
||||||
this._state.Repeat = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.AnimationProperties.asc_getTriggerClickSequence()) {
|
|
||||||
this._state.trigger = this.view.triggers.ClickSequence;
|
|
||||||
this._state.TriggerValue = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this._state.trigger = this.view.triggers.ClickOf;
|
|
||||||
this._state.TriggerValue = this.AnimationProperties.asc_getTriggerObjectClick();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._state.StartSelect = this.AnimationProperties.asc_getStartType();
|
|
||||||
this._state.RepeatCount = this.AnimationProperties.asc_getRepeatCount();
|
|
||||||
this._state.Rewind = this.AnimationProperties.asc_getRewind();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onActiveTab: function(tab) {
|
onActiveTab: function(tab) {
|
||||||
if (tab == 'animate') {
|
if (tab == 'animate') {
|
||||||
this._state.onactivetab = true;
|
this._state.onactivetab = true;
|
||||||
|
|
||||||
this.setLocked();
|
|
||||||
this.setSettings();
|
this.setSettings();
|
||||||
}
|
}
|
||||||
else this._state.onactivetab = false;
|
else this._state.onactivetab = false;
|
||||||
|
@ -354,48 +389,14 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setLocked: function() {
|
setLocked: function() {
|
||||||
/* if (this._state.lockedanimation != undefined)
|
if (this._state.noGraphic != undefined)
|
||||||
this.lockToolbar(PE.enumLock.animationLock, this._state.lockedanimation);*/
|
this.lockToolbar(PE.enumLock.noGraphic, this._state.noGraphic);
|
||||||
},
|
if (this._state.noAnimation != undefined)
|
||||||
|
this.lockToolbar(PE.enumLock.noAnimation, this._state.noAnimation);
|
||||||
setSettings: function () {
|
if (this._state.noAnimationParam != undefined)
|
||||||
var me = this.view;
|
this.lockToolbar(PE.enumLock.noAnimationParam, this._state.noAnimationParam);
|
||||||
var item;
|
if (this._state.noTriggerObjects != undefined)
|
||||||
this.setTriggerList();
|
this.lockToolbar(PE.enumLock.noTriggerObjects, this._state.noTriggerObjects);
|
||||||
if (this._state.Effect !== undefined) {
|
|
||||||
item = me.listEffects.store.findWhere({value: this._state.Effect});
|
|
||||||
me.listEffects.menuPicker.selectRecord(item ? item : me.listEffects.menuPicker.items[0]);
|
|
||||||
this.view.btnParameters.setIconCls('toolbar__icon icon ' + item.get('iconCls'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._state.EffectOption !== undefined)
|
|
||||||
me.setMenuParameters(this._state.Effect, this._state.EffectOption);
|
|
||||||
|
|
||||||
me.numDuration.setValue((this._state.Duration !== null && this._state.Duration !== undefined) ? this._state.Duration / 1000. : '', true);
|
|
||||||
me.numDelay.setValue((this._state.Delay !== null && this._state.Delay !== undefined) ? this._state.Delay / 1000. : '', true);
|
|
||||||
me.numRepeat.setValue((this._state.Repeat !== null && this._state.Repeat !== undefined) ? this._state.Repeat / 1000. : '', true);
|
|
||||||
|
|
||||||
(this._state.StartSelect==undefined)&&(this._state.StartSelect = AscFormat.NODE_TYPE_CLICKEFFECT);
|
|
||||||
item = me.cmbStart.store.findWhere({value: this._state.StartSelect});
|
|
||||||
me.cmbStart.selectRecord(item);
|
|
||||||
me.chRewind.setValue(this._state.Rewind, true);
|
|
||||||
|
|
||||||
var obj;
|
|
||||||
obj =(this._state.trigger == me.triggers.ClickSequence)?me.cmbTrigger.menu.items[0] : _.findWhere(me.btnClickOf.menu.items,{caption: this._state.TriggerValue});
|
|
||||||
if(obj) {
|
|
||||||
obj.setChecked(true);
|
|
||||||
//me.cmbTrigger.setCaption(obj.caption);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setTriggerList: function (){
|
|
||||||
this.objectNames = this.api.asc_getCurSlideObjectsNames();
|
|
||||||
if(this.countObjects == this.objectNames.length) return;
|
|
||||||
this.view.btnClickOf.menu.removeAll();
|
|
||||||
var btnMemnu=this.view.btnClickOf.menu;
|
|
||||||
this.objectNames.forEach(function (item){
|
|
||||||
btnMemnu.addItem({ caption: item, checkable: true, toggleGroup: 'animtrigger'});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, PE.Controllers.Animation || {}));
|
}, PE.Controllers.Animation || {}));
|
||||||
|
|
|
@ -167,8 +167,9 @@ define([
|
||||||
].join('')),
|
].join('')),
|
||||||
groups: new Common.UI.DataViewGroupStore([{id: 'none', value: -10, caption: this.textNone}].concat(Common.define.effectData.getEffectGroupData())),
|
groups: new Common.UI.DataViewGroupStore([{id: 'none', value: -10, caption: this.textNone}].concat(Common.define.effectData.getEffectGroupData())),
|
||||||
store: new Common.UI.DataViewStore(this._arrEffectName),
|
store: new Common.UI.DataViewStore(this._arrEffectName),
|
||||||
|
additionalMenuItems: [{caption: '--'}, this.listEffectsMore],
|
||||||
enableKeyEvents: true,
|
enableKeyEvents: true,
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'bottom',
|
dataHintDirection: 'bottom',
|
||||||
dataHintOffset: '-16, 0',
|
dataHintOffset: '-16, 0',
|
||||||
|
@ -201,7 +202,7 @@ define([
|
||||||
caption: this.txtPreview,
|
caption: this.txtPreview,
|
||||||
split: false,
|
split: false,
|
||||||
iconCls: 'toolbar__icon preview-transitions',
|
iconCls: 'toolbar__icon preview-transitions',
|
||||||
lock: [_set.slideDeleted, _set.noSlides],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noAnimation],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
dataHintOffset: 'medium'
|
dataHintOffset: 'medium'
|
||||||
|
@ -213,7 +214,7 @@ define([
|
||||||
caption: this.txtParameters,
|
caption: this.txtParameters,
|
||||||
iconCls: 'toolbar__icon icon transition-none',
|
iconCls: 'toolbar__icon icon transition-none',
|
||||||
menu: new Common.UI.Menu({items: []}),
|
menu: new Common.UI.Menu({items: []}),
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationParam],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'bottom',
|
dataHintDirection: 'bottom',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
|
@ -225,7 +226,7 @@ define([
|
||||||
caption: this.txtAnimationPane,
|
caption: this.txtAnimationPane,
|
||||||
split: true,
|
split: true,
|
||||||
iconCls: 'toolbar__icon transition-apply-all',
|
iconCls: 'toolbar__icon transition-apply-all',
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
dataHintOffset: 'medium'
|
dataHintOffset: 'medium'
|
||||||
|
@ -237,7 +238,7 @@ define([
|
||||||
caption: this.txtAddEffect,
|
caption: this.txtAddEffect,
|
||||||
iconCls: 'toolbar__icon icon btn-addslide',
|
iconCls: 'toolbar__icon icon btn-addslide',
|
||||||
menu: true,
|
menu: true,
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'bottom',
|
dataHintDirection: 'bottom',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
|
@ -253,7 +254,7 @@ define([
|
||||||
defaultUnit: this.txtSec,
|
defaultUnit: this.txtSec,
|
||||||
maxValue: 300,
|
maxValue: 300,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'top',
|
dataHintDirection: 'top',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
|
@ -265,6 +266,7 @@ define([
|
||||||
cls: 'btn-text-split-default',
|
cls: 'btn-text-split-default',
|
||||||
split: true,
|
split: true,
|
||||||
width: 82,
|
width: 82,
|
||||||
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
style : 'min-width: 150px;',
|
style : 'min-width: 150px;',
|
||||||
items: [
|
items: [
|
||||||
|
@ -298,7 +300,7 @@ define([
|
||||||
defaultUnit: this.txtSec,
|
defaultUnit: this.txtSec,
|
||||||
maxValue: 300,
|
maxValue: 300,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'bottom',
|
dataHintDirection: 'bottom',
|
||||||
dataHintOffset: 'big'
|
dataHintOffset: 'big'
|
||||||
|
@ -308,7 +310,7 @@ define([
|
||||||
this.cmbStart = new Common.UI.ComboBox({
|
this.cmbStart = new Common.UI.ComboBox({
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'width: 150px;',
|
menuStyle: 'width: 150px;',
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
||||||
data: [
|
data: [
|
||||||
{value: AscFormat.NODE_TYPE_CLICKEFFECT, displayValue: this.textStartOnClick},
|
{value: AscFormat.NODE_TYPE_CLICKEFFECT, displayValue: this.textStartOnClick},
|
||||||
{value: AscFormat.NODE_TYPE_WITHEFFECT, displayValue: this.textStartWithPrevious},
|
{value: AscFormat.NODE_TYPE_WITHEFFECT, displayValue: this.textStartWithPrevious},
|
||||||
|
@ -322,7 +324,7 @@ define([
|
||||||
this.chRewind = new Common.UI.CheckBox({
|
this.chRewind = new Common.UI.CheckBox({
|
||||||
el: this.$el.find('#animation-checkbox-rewind'),
|
el: this.$el.find('#animation-checkbox-rewind'),
|
||||||
labelText: this.strRewind,
|
labelText: this.strRewind,
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
|
@ -337,15 +339,13 @@ define([
|
||||||
maxValue: 1000,
|
maxValue: 1000,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
defaultUnit: '',
|
defaultUnit: '',
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'bottom',
|
dataHintDirection: 'bottom',
|
||||||
dataHintOffset: 'big'
|
dataHintOffset: 'big'
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.numRepeat);
|
this.lockedControls.push(this.numRepeat);
|
||||||
|
|
||||||
Common.Utils.lockControls(PE.enumLock.disableOnStart, true, {array: this.lockedControls});
|
|
||||||
|
|
||||||
this.$el.find('#animation-duration').text(this.strDuration);
|
this.$el.find('#animation-duration').text(this.strDuration);
|
||||||
this.$el.find('#animation-delay').text(this.strDelay);
|
this.$el.find('#animation-delay').text(this.strDelay);
|
||||||
this.$el.find('#animation-label-start').text(this.strStart);
|
this.$el.find('#animation-label-start').text(this.strStart);
|
||||||
|
@ -442,25 +442,13 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
getButtons: function (type) {
|
getButtons: function (type) {
|
||||||
if (type === undefined)
|
return this.lockedControls;
|
||||||
return this.lockedControls;
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
|
|
||||||
setDisabled: function (state) {
|
|
||||||
this.lockedControls && this.lockedControls.forEach(function (button) {
|
|
||||||
button.setDisabled(state);
|
|
||||||
}, this);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setMenuParameters: function (effectId, option)
|
setMenuParameters: function (effectId, option)
|
||||||
{
|
{
|
||||||
var effect = this.listEffects.store.findWhere({value: effectId});
|
var effect = this.listEffects.store.findWhere({value: effectId});
|
||||||
var arrEffectOptions = Common.define.effectData.getEffectOptionsData(effect.get('group'), effect.get('value'));
|
var arrEffectOptions = Common.define.effectData.getEffectOptionsData(effect.get('group'), effect.get('value'));
|
||||||
if (!this.listEffects.isDisabled()) {
|
|
||||||
this.btnParameters.setDisabled(!arrEffectOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!arrEffectOptions) {
|
if(!arrEffectOptions) {
|
||||||
this.btnParameters.menu.removeAll();
|
this.btnParameters.menu.removeAll();
|
||||||
this._effectId = effectId
|
this._effectId = effectId
|
||||||
|
@ -505,6 +493,7 @@ define([
|
||||||
textOnClickSequence: 'On Click Sequence',
|
textOnClickSequence: 'On Click Sequence',
|
||||||
textOnClickOf: 'On Click of',
|
textOnClickOf: 'On Click of',
|
||||||
textNone: 'None',
|
textNone: 'None',
|
||||||
|
textMultiple: 'Multiple',
|
||||||
textMoreEffects: 'Show More Effects'
|
textMoreEffects: 'Show More Effects'
|
||||||
}
|
}
|
||||||
}()), PE.Views.Animation || {}));
|
}()), PE.Views.Animation || {}));
|
||||||
|
|
|
@ -125,7 +125,7 @@ define([
|
||||||
|
|
||||||
onGroupSelect: function (combo, record) {
|
onGroupSelect: function (combo, record) {
|
||||||
this._state.activeGroup = record.id;
|
this._state.activeGroup = record.id;
|
||||||
this._state.activeGroupValue = record.get('value');
|
this._state.activeGroupValue = record.value;
|
||||||
this.cmbLevel.store.reset(Common.define.effectData.getLevelEffect(record.id == 'menu-effect-group-path'));
|
this.cmbLevel.store.reset(Common.define.effectData.getLevelEffect(record.id == 'menu-effect-group-path'));
|
||||||
this.cmbLevel.selectRecord(this.cmbLevel.store.models[0]);
|
this.cmbLevel.selectRecord(this.cmbLevel.store.models[0]);
|
||||||
this.onLevelSelect(undefined,this.cmbLevel.store.models[0]);
|
this.onLevelSelect(undefined,this.cmbLevel.store.models[0]);
|
||||||
|
|
|
@ -84,7 +84,11 @@ define([
|
||||||
inEquation: 'in-equation',
|
inEquation: 'in-equation',
|
||||||
commentLock: 'can-comment',
|
commentLock: 'can-comment',
|
||||||
noColumns: 'no-columns',
|
noColumns: 'no-columns',
|
||||||
transitLock: 'transit-lock'
|
transitLock: 'transit-lock',
|
||||||
|
noGraphic: 'no-graphic',
|
||||||
|
noAnimation: 'no-animation',
|
||||||
|
noAnimationParam: 'no-animation-params',
|
||||||
|
noTriggerObjects: 'no-trigger-objects'
|
||||||
};
|
};
|
||||||
|
|
||||||
PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){
|
PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){
|
||||||
|
|
Loading…
Reference in a new issue