From d9ef7a349fc327bfebfd172b61685b1e8f732f79 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 8 Dec 2022 16:40:09 +0300 Subject: [PATCH] [PE] Change duration combobox in animation tab (show only seconds) --- apps/common/main/lib/component/ComboBox.js | 4 ++-- apps/presentationeditor/main/app/view/Animation.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index 1eb060eb2..3164abd68 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -710,8 +710,8 @@ define([ this.options.updateFormControl.call(this, this._selectedItem); }, - setValue: function(value) { - Common.UI.ComboBox.prototype.setValue.call(this, value); + setValue: function(value, defValue) { + Common.UI.ComboBox.prototype.setValue.call(this, value, defValue); if (this.options.updateFormControl) this.options.updateFormControl.call(this, this._selectedItem); }, diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 4358439fb..6d1f4d87d 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -187,6 +187,7 @@ define([ this.toolbar = options.toolbar; this.appConfig = options.mode; this.$el = this.toolbar.toolbar.$el.find('#animation-panel'); + var me = this; var _set = Common.enumLock; this.lockedControls = []; this._arrEffectName = [{group:'none', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'animation-none', displayValue: this.textNone}].concat(Common.define.effectData.getEffectData()); @@ -293,7 +294,7 @@ define([ this.lockedControls.push(this.btnAddAnimation); - this.cmbDuration = new Common.UI.ComboBox({ + this.cmbDuration = new Common.UI.ComboBoxCustom({ el: this.$el.find('#animation-spin-duration'), cls: 'input-group-nr', menuStyle: 'min-width: 100%;', @@ -309,7 +310,10 @@ define([ lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration, _set.timingLock], dataHint: '1', dataHintDirection: 'top', - dataHintOffset: 'small' + dataHintOffset: 'small', + updateFormControl: function(record) { + record && this.setRawValue(record.get('value') + ' ' + me.txtSec); + } }); this.lockedControls.push(this.cmbDuration);