Change numRepeat
This commit is contained in:
parent
47b5e9d322
commit
eaab1e2fa3
|
@ -63,21 +63,24 @@ define([
|
||||||
|
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'PE.Views.Animation': {
|
'PE.Views.Animation': {
|
||||||
'animation:preview': _.bind(this.onPreviewClick, this),
|
'animation:preview': _.bind(this.onPreviewClick, this),
|
||||||
'animation:parameters': _.bind(this.onParameterClick, this),
|
'animation:parameters': _.bind(this.onParameterClick, this),
|
||||||
'animation:duration': _.bind(this.onDurationChange, this),
|
'animation:duration': _.bind(this.onDurationChange, this),
|
||||||
'animation:selecteffect': _.bind(this.onEffectSelect, this),
|
'animation:selecteffect': _.bind(this.onEffectSelect, this),
|
||||||
'animation:delay': _.bind(this.onDelayChange, this),
|
'animation:delay': _.bind(this.onDelayChange, this),
|
||||||
'animation:animationpane': _.bind(this.onAnimationPane, this),
|
'animation:animationpane': _.bind(this.onAnimationPane, this),
|
||||||
'animation:addanimation': _.bind(this.onAddAnimation, this),
|
'animation:addanimation': _.bind(this.onAddAnimation, this),
|
||||||
'animation:startselect': _.bind(this.onStartSelect, this),
|
'animation:startselect': _.bind(this.onStartSelect, this),
|
||||||
'animation:checkrewind': _.bind(this.onCheckRewindChange,this),
|
'animation:checkrewind': _.bind(this.onCheckRewindChange,this),
|
||||||
'animation:repeat': _.bind(this.onRepeatChange, this),
|
'animation:repeat': _.bind(this.onRepeatChange, this),
|
||||||
'animation:additional': _.bind(this.onAnimationAdditional, this),
|
'animation:additional': _.bind(this.onAnimationAdditional, this),
|
||||||
'animation:trigger': _.bind(this.onTriggerClick, this),
|
'animation:trigger': _.bind(this.onTriggerClick, this),
|
||||||
'animation:triggerclickof': _.bind(this.onTriggerClickOfClick, this),
|
'animation:triggerclickof': _.bind(this.onTriggerClickOfClick, this),
|
||||||
'animation:moveearlier': _.bind(this.onMoveEarlier, this),
|
'animation:moveearlier': _.bind(this.onMoveEarlier, this),
|
||||||
'animation:movelater': _.bind(this.onMoveLater, this)
|
'animation:movelater': _.bind(this.onMoveLater, this),
|
||||||
|
'animation:repeatchangebefore': _.bind(this.onRepeatChange, this),
|
||||||
|
'animation:repeatchangeafter': _.bind(this.onRepeatChange, this),
|
||||||
|
'animation:repeatselected': _.bind(this.onRepeatSelected, this)
|
||||||
},
|
},
|
||||||
'Toolbar': {
|
'Toolbar': {
|
||||||
'tab:active': _.bind(this.onActiveTab, this)
|
'tab:active': _.bind(this.onActiveTab, this)
|
||||||
|
@ -197,14 +200,32 @@ define([
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onRepeatChange: function (before,combo, record, e){
|
||||||
|
var value,
|
||||||
|
me = this;
|
||||||
|
if(before)
|
||||||
|
{
|
||||||
|
|
||||||
onRepeatChange: function (field, newValue, oldValue, eOpts){
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onRepeatSelected: function (combo, record) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
this.AnimationProperties.asc_putRepeatCount(field.getNumberValue() * 1000);
|
this.AnimationProperties.asc_putRepeatCount(record.value);
|
||||||
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
this.api.asc_SetAnimationProperties(this.AnimationProperties);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onRepeatComboOpen: function(needfocus, combo) {
|
||||||
|
_.delay(function() {
|
||||||
|
var input = $('input', combo.cmpEl).select();
|
||||||
|
if (needfocus) input.focus();
|
||||||
|
else if (!combo.isMenuOpen()) input.one('mouseup', function (e) { e.preventDefault(); });
|
||||||
|
}, 10);
|
||||||
|
},
|
||||||
|
|
||||||
onMoveEarlier: function () {
|
onMoveEarlier: function () {
|
||||||
if(this.api) {
|
if(this.api) {
|
||||||
this.api.asc_moveAnimationEarlier();
|
this.api.asc_moveAnimationEarlier();
|
||||||
|
@ -250,6 +271,8 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onCheckRewindChange: function (field, newValue, oldValue, eOpts) {
|
onCheckRewindChange: function (field, newValue, oldValue, eOpts) {
|
||||||
if (this.api && this.AnimationProperties) {
|
if (this.api && this.AnimationProperties) {
|
||||||
this.AnimationProperties.asc_putRewind(field.getValue() == 'checked');
|
this.AnimationProperties.asc_putRewind(field.getValue() == 'checked');
|
||||||
|
@ -359,13 +382,8 @@ define([
|
||||||
this._state.Delay = value;
|
this._state.Delay = value;
|
||||||
view.numDelay.setValue((this._state.Delay !== null && this._state.Delay !== undefined) ? this._state.Delay / 1000. : '', true);
|
view.numDelay.setValue((this._state.Delay !== null && this._state.Delay !== undefined) ? this._state.Delay / 1000. : '', true);
|
||||||
}
|
}
|
||||||
value = this.AnimationProperties.asc_getRepeatCount();
|
this._state.Repeat = this.AnimationProperties.asc_getRepeatCount();
|
||||||
if (Math.abs(this._state.Repeat - value) > 0.001 ||
|
view.cmbRepeat.setValue((this._state.Repeat !== null && this._state.Repeat !== undefined) ? this._state.Repeat/1000. : 1);
|
||||||
(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();
|
this._state.StartSelect = this.AnimationProperties.asc_getStartType();
|
||||||
view.cmbStart.setValue(this._state.StartSelect!==undefined ? this._state.StartSelect : AscFormat.NODE_TYPE_CLICKEFFECT);
|
view.cmbStart.setValue(this._state.StartSelect!==undefined ? this._state.StartSelect : AscFormat.NODE_TYPE_CLICKEFFECT);
|
||||||
|
|
|
@ -260,7 +260,7 @@
|
||||||
<div class="group small">
|
<div class="group small">
|
||||||
<div class="elset font-normal">
|
<div class="elset font-normal">
|
||||||
<label id="animation-repeat"></label>
|
<label id="animation-repeat"></label>
|
||||||
<span id="animation-spin-repeat" class="btn-slot text spinner" ></span>
|
<div id="animation-spin-repeat" style="width: 55px; " class="btn-slot" ></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="elset font-normal">
|
<div class="elset font-normal">
|
||||||
<span class="btn-slot text" id="animation-checkbox-rewind"></span>
|
<span class="btn-slot text" id="animation-checkbox-rewind"></span>
|
||||||
|
|
|
@ -117,9 +117,21 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.numRepeat) {
|
if (me.cmbRepeat) {
|
||||||
me.numRepeat.on('change', function(bth) {
|
me.cmbRepeat.on('change:before', function (combo, record) {
|
||||||
me.fireEvent('animation:repeat', [me.numRepeat]);
|
me.fireEvent('animation:repeatchangebefore', [true, combo, record]);
|
||||||
|
}, me);
|
||||||
|
me.cmbRepeat.on('change:after', function (combo, record) {
|
||||||
|
me.fireEvent('animation:repeatchangeafter', [false, combo, record]);
|
||||||
|
}, me);
|
||||||
|
me.cmbRepeat.on('selected', function (combo, record) {
|
||||||
|
me.fireEvent('animation:repeatselected', [combo, record]);
|
||||||
|
}, me);
|
||||||
|
me.cmbRepeat.on('show:after', function (needfocus, combo) {
|
||||||
|
me.fireEvent('animation:repeatopen', [needfocus, combo]);
|
||||||
|
}, me);
|
||||||
|
me.cmbRepeat.on('combo:focusin', function (needfocus, combo) {
|
||||||
|
me.fireEvent('animation:repeatopen', [needfocus, combo]);
|
||||||
}, me);
|
}, me);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,20 +356,27 @@ define([
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.chRewind);
|
this.lockedControls.push(this.chRewind);
|
||||||
|
|
||||||
this.numRepeat = new Common.UI.MetricSpinner({
|
this.cmbRepeat = new Common.UI.ComboBox({
|
||||||
el: this.$el.find('#animation-spin-repeat'),
|
el: this.$el.find('#animation-spin-repeat'),
|
||||||
step: 1,
|
cls: 'input-group-nr',
|
||||||
width: 55,
|
menuStyle: 'min-width: 100%;',
|
||||||
value: '',
|
editable: true,
|
||||||
maxValue: 1000,
|
|
||||||
minValue: 0,
|
|
||||||
defaultUnit: '',
|
|
||||||
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation],
|
||||||
|
data: [
|
||||||
|
{value: 1, displayValue: this.textNoRepeat},
|
||||||
|
{value: 2, displayValue: "2"},
|
||||||
|
{value: 3, displayValue: "3"},
|
||||||
|
{value: 4, displayValue: "4"},
|
||||||
|
{value: 5, displayValue: "5"},
|
||||||
|
{value: 10, displayValue: "10"},
|
||||||
|
{value: AscFormat.untilNextClick, displayValue: this.textUntilNextClick},
|
||||||
|
{value: AscFormat.untilNextSlide, displayValue: this.textUntilEndOfSlide}
|
||||||
|
],
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'top',
|
dataHintDirection: 'top',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.numRepeat);
|
this.lockedControls.push(this.cmbRepeat);
|
||||||
|
|
||||||
this.btnMoveEarlier = new Common.UI.Button({
|
this.btnMoveEarlier = new Common.UI.Button({
|
||||||
parentEl: $('#animation-moveearlier'),
|
parentEl: $('#animation-moveearlier'),
|
||||||
|
@ -457,7 +476,7 @@ define([
|
||||||
this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start'));
|
this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start'));
|
||||||
this.renderComponent('#animation-spin-duration', this.numDuration);
|
this.renderComponent('#animation-spin-duration', this.numDuration);
|
||||||
this.renderComponent('#animation-spin-delay', this.numDelay);
|
this.renderComponent('#animation-spin-delay', this.numDelay);
|
||||||
this.renderComponent('#animation-spin-repeat', this.numRepeat);
|
this.renderComponent('#animation-spin-repeat', this.cmbRepeat);
|
||||||
this.$el.find("#animation-duration").innerText = this.strDuration;
|
this.$el.find("#animation-duration").innerText = this.strDuration;
|
||||||
this.$el.find("#animation-delay").innerText = this.strDelay;
|
this.$el.find("#animation-delay").innerText = this.strDelay;
|
||||||
this.$el.find("#animation-label-start").innerText = this.strStart;
|
this.$el.find("#animation-label-start").innerText = this.strStart;
|
||||||
|
@ -534,7 +553,10 @@ define([
|
||||||
textMultiple: 'Multiple',
|
textMultiple: 'Multiple',
|
||||||
textMoreEffects: 'Show More Effects',
|
textMoreEffects: 'Show More Effects',
|
||||||
textMoveEarlier: 'Move Earlier',
|
textMoveEarlier: 'Move Earlier',
|
||||||
textMoveLater: 'Move Later'
|
textMoveLater: 'Move Later',
|
||||||
|
textNoRepeat: '(none)',
|
||||||
|
textUntilNextClick: 'Until Next Click',
|
||||||
|
textUntilEndOfSlide: 'Until End of Slide'
|
||||||
}
|
}
|
||||||
}()), PE.Views.Animation || {}));
|
}()), PE.Views.Animation || {}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue