Fix view
This commit is contained in:
parent
4b1d2b6dc3
commit
205750bb82
|
@ -68,7 +68,7 @@ define([
|
|||
'animation:selecteffect': _.bind(this.onEffectSelect, this),
|
||||
'animation:delay': _.bind(this.onDelayChange, this),
|
||||
'animation:animationpane':_.bind(this.onAnimationPane, this),
|
||||
'animation:addeffect': _.bind(this.onAddEffect, this),
|
||||
'animation:addanimation': _.bind(this.onAddAnimation, this),
|
||||
'animation:startselect': _.bind(this.onStartSelect, this),
|
||||
},
|
||||
'Toolbar': {
|
||||
|
@ -119,16 +119,15 @@ define([
|
|||
|
||||
},
|
||||
|
||||
onParameterClick: function (item) {
|
||||
this._state.EffectType = item.value;
|
||||
|
||||
onParameterClick: function (value) {
|
||||
this._state.EffectType = value;
|
||||
},
|
||||
|
||||
onAnimationPane: function() {
|
||||
|
||||
},
|
||||
|
||||
onAddEffect: function() {
|
||||
onAddAnimation: function() {
|
||||
|
||||
},
|
||||
|
||||
|
@ -142,13 +141,16 @@ define([
|
|||
|
||||
onEffectSelect: function (combo, record) {
|
||||
var type = record.get('value');
|
||||
var parameter = this._state.EffectType;
|
||||
|
||||
if (this.Effect !== type &&
|
||||
!((this.Effect === Asc.c_oAscSlideTransitionTypes.Wipe || this.Effect === Asc.c_oAscSlideTransitionTypes.UnCover || this.Effect === Asc.c_oAscSlideTransitionTypes.Cover)&&
|
||||
(type === Asc.c_oAscSlideTransitionTypes.Wipe || type === Asc.c_oAscSlideTransitionTypes.UnCover || type === Asc.c_oAscSlideTransitionTypes.Cover)))
|
||||
parameter = this.view.setMenuParameters(type);
|
||||
|
||||
this._state.Effect = type;
|
||||
this.onParameterClick(parameter);
|
||||
|
||||
if (this._state.Effect !== type) {
|
||||
this._state.Effect = type;
|
||||
var parameter = this.view.setMenuParameters(type);
|
||||
if (parameter)
|
||||
this.onParameterClick(parameter);
|
||||
}
|
||||
},
|
||||
|
||||
onStartSelect: function (combo, record) {
|
||||
|
|
|
@ -184,6 +184,15 @@
|
|||
<div class="group small">
|
||||
<span class="btn-slot text x-huge" id="animation-button-parameters"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group small">
|
||||
<div class="elset">
|
||||
<span class="btn-slot text " id="animation-button-add-effect"></span>
|
||||
</div>
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="animation-button-preview"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group small" style = "min-width: 130px;">
|
||||
<div class="elset font-normal">
|
||||
|
@ -193,7 +202,6 @@
|
|||
<div class="elset">
|
||||
<span class="btn-slot text " id="animation-button-pane"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group small" style = "min-width: 122px;">
|
||||
|
@ -206,16 +214,17 @@
|
|||
<span id="animation-spin-duration" class="btn-slot text spinner" style="float: right"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="separator long"></div>
|
||||
<div class="group small">
|
||||
<div class="elset">
|
||||
<span class="btn-slot text " id="animation-button-add-effect"></span>
|
||||
<div class="group small" style = "min-width: 122px;">
|
||||
<div class="elset font-normal">
|
||||
<span class="btn-slot text" id="animation-checkbox-rewind"></span>
|
||||
</div>
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="animation-button-preview"></span>
|
||||
<div class="elset font-normal">
|
||||
<label id="animation-repeat"></label>
|
||||
<span id="animation-spin-repeat" class="btn-slot text spinner" ></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -70,12 +70,8 @@ define([
|
|||
}
|
||||
|
||||
if (me.btnParameters) {
|
||||
me.btnParameters.on('click', function (e) {
|
||||
me.fireEvent('animation:parameters', ['current']);
|
||||
});
|
||||
|
||||
me.btnParameters.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('animation:parameters', [item]);
|
||||
me.fireEvent('animation:parameters', [item.value]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -84,9 +80,9 @@ define([
|
|||
me.fireEvent('animation:animationpane', [me.btnAnimationPane]);
|
||||
}, me));
|
||||
}
|
||||
if (me.btnAddEffect) {
|
||||
me.btnAddEffect.on('click', _.bind(function(btn) {
|
||||
me.fireEvent('animation:addeffect', [me.btnAddEffect]);
|
||||
if (me.btnAddAnimation) {
|
||||
me.btnAddAnimation.on('click', _.bind(function(btn) {
|
||||
me.fireEvent('animation:addanimation', [me.btnAddAnimation]);
|
||||
}, me));
|
||||
}
|
||||
|
||||
|
@ -109,6 +105,12 @@ define([
|
|||
})
|
||||
}
|
||||
|
||||
if (me.numRepeat) {
|
||||
me.numRepeat.on('change', function(bth) {
|
||||
me.fireEvent('animation:repeat', [me.numRepeat]);
|
||||
}, me);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -218,7 +220,7 @@ define([
|
|||
});
|
||||
this.lockedControls.push(this.btnAnimationPane);
|
||||
|
||||
this.btnAddEffect = new Common.UI.Button({
|
||||
this.btnAddAnimation = new Common.UI.Button({
|
||||
cls: 'btn-toolbar',
|
||||
caption: this.txtAddEffect,
|
||||
split: true,
|
||||
|
@ -228,7 +230,7 @@ define([
|
|||
dataHintDirection: 'left',
|
||||
dataHintOffset: 'medium'
|
||||
});
|
||||
this.lockedControls.push(this.btnAddEffect);
|
||||
this.lockedControls.push(this.btnAddAnimation);
|
||||
|
||||
this.numDuration = new Common.UI.MetricSpinner({
|
||||
el: this.$el.find('#animation-spin-duration'),
|
||||
|
@ -274,11 +276,35 @@ define([
|
|||
});
|
||||
this.lockedControls.push(this.cmbStart);
|
||||
|
||||
this.chRewind = new Common.UI.CheckBox({
|
||||
el: this.$el.find('#animation-checkbox-rewind'),
|
||||
labelText: this.strRewind,
|
||||
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'left',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.chRewind);
|
||||
|
||||
this.numRepeat = new Common.UI.MetricSpinner({
|
||||
el: this.$el.find('#animation-spin-repeat'),
|
||||
step: 1,
|
||||
width: 52,
|
||||
value: '',
|
||||
maxValue: 300,
|
||||
minValue: 0,
|
||||
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'big'
|
||||
});
|
||||
|
||||
Common.Utils.lockControls(PE.enumLock.disableOnStart, true, {array: this.lockedControls});
|
||||
|
||||
this.$el.find('#animation-duration').text(this.strDuration);
|
||||
this.$el.find('#animation-delay').text(this.strDelay);
|
||||
this.$el.find('#animation-label-start').text(this.strStart);
|
||||
this.$el.find('#animation-repeat').text(this.strRepeat);
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
},
|
||||
|
||||
|
@ -340,13 +366,15 @@ define([
|
|||
this.btnPreview && this.btnPreview.render(this.$el.find('#animation-button-preview'));
|
||||
this.btnParameters && this.btnParameters.render(this.$el.find('#animation-button-parameters'));
|
||||
this.btnAnimationPane && this.btnAnimationPane.render(this.$el.find('#animation-button-pane'));
|
||||
this.btnAddEffect && this.btnAddEffect.render(this.$el.find('#animation-button-add-effect'));
|
||||
this.btnAddAnimation && this.btnAddAnimation.render(this.$el.find('#animation-button-add-effect'));
|
||||
this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start'))
|
||||
this.renderComponent('#animation-spin-duration', this.numDuration);
|
||||
this.renderComponent('#animation-spin-delay', this.numDelay);
|
||||
this.renderComponent('#animation-spin-repeat', this.numRepeat);
|
||||
this.$el.find("#animation-duration").innerText = this.strDuration;
|
||||
this.$el.find("#animation-delay").innerText = this.strDelay;
|
||||
this.$el.find("#animation-label-start").innerText = this.strStart;
|
||||
this.$el.find("#animation-repeat").innerText = this.strRepeat;
|
||||
return this.$el;
|
||||
},
|
||||
|
||||
|
@ -406,9 +434,9 @@ define([
|
|||
var selectedElement;
|
||||
_.each(this.btnParameters.menu.items, function (element, index) {
|
||||
if (((index < minMax[0])||(index > minMax[1])))
|
||||
element.$el.css('display', 'none');
|
||||
element.setVisible(false);
|
||||
else {
|
||||
element.$el.css('display', '');
|
||||
element.setVisible(true);
|
||||
|
||||
if (value != undefined) {
|
||||
if (value == element.value) selectedElement = element;
|
||||
|
@ -427,7 +455,7 @@ define([
|
|||
this.btnPreview.setDisabled(effect === Asc.c_oAscSlideTransitionTypes.None);
|
||||
this.numDuration.setDisabled(effect === Asc.c_oAscSlideTransitionTypes.None);
|
||||
}
|
||||
return selectedElement;
|
||||
return (selectedElement)?selectedElement.value:-1;
|
||||
},
|
||||
|
||||
|
||||
|
@ -435,10 +463,12 @@ define([
|
|||
txtPreview: 'Preview',
|
||||
txtParameters: 'Parameters',
|
||||
txtAnimationPane: 'Animation Pane',
|
||||
txtAddEffect: 'Add effect',
|
||||
txtAddEffect: 'Add animation',
|
||||
strDuration: 'Duration',
|
||||
strDelay: 'Delay',
|
||||
strStart: 'Start',
|
||||
strRewind: 'Rewind',
|
||||
strRepeat: 'Repeat',
|
||||
|
||||
textStartOnClick: 'On Click',
|
||||
textStartBeforePrevious: 'Before Previous',
|
||||
|
|
Loading…
Reference in a new issue