[PE] Fix Bug 26518

This commit is contained in:
Julia Radzhabova 2020-11-28 00:23:26 +03:00
parent 23e9b70fec
commit 0cdea5cec9
5 changed files with 54 additions and 6 deletions

View file

@ -266,6 +266,8 @@ define([
toolbar.btnRedo.on('disabled', _.bind(this.onBtnChangeState, this, 'redo:disabled'));
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
toolbar.btnIncFontSize.on('click', _.bind(this.onIncrease, this));
toolbar.btnDecFontSize.on('click', _.bind(this.onDecrease, this));
toolbar.btnBold.on('click', _.bind(this.onBold, this));
toolbar.btnItalic.on('click', _.bind(this.onItalic, this));
toolbar.btnUnderline.on('click', _.bind(this.onUnderline, this));
@ -992,6 +994,22 @@ define([
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
},
onIncrease: function(e) {
if (this.api)
this.api.FontSizeIn();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Font Size');
},
onDecrease: function(e) {
if (this.api)
this.api.FontSizeOut();
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Font Size');
},
onBold: function(btn, e) {
this._state.bold = undefined;
if (this.api)

View file

@ -43,18 +43,20 @@
</div>
<div class="separator long"></div>
<div class="group">
<div class="elset" style="width:191px;">
<span class="btn-slot" style="float: left; width: 144px;" id="slot-field-fontname"></span>
<div class="elset" style="width:207px;">
<span class="btn-slot" style="float: left; width: 115px;" id="slot-field-fontname"></span>
<span class="btn-slot" style="float: left; width: 45px; margin-left: 2px;" id="slot-field-fontsize"></span>
<span class="btn-slot" id="slot-btn-incfont"></span>
<span class="btn-slot" id="slot-btn-decfont"></span>
</div>
<div class="elset font-attr">
<span class="btn-slot" id="slot-btn-bold"></span>
<span class="btn-slot" id="slot-btn-italic"></span>
<span class="btn-slot" id="slot-btn-underline"></span>
<span class="btn-slot" id="slot-btn-strikeout"></span>
<span class="btn-slot split" id="slot-btn-fontcolor"></span>
<span class="btn-slot" id="slot-btn-superscript"></span>
<span class="btn-slot" id="slot-btn-subscript"></span>
<span class="btn-slot split" id="slot-btn-fontcolor"></span>
</div>
</div>
<div class="separator long"></div>

View file

@ -261,6 +261,22 @@ define([
});
me.paragraphControls.push(me.cmbFontSize);
me.btnIncFontSize = new Common.UI.Button({
id: 'id-toolbar-btn-incfont',
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-incfont',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock]
});
me.paragraphControls.push(me.btnIncFontSize);
me.btnDecFontSize = new Common.UI.Button({
id: 'id-toolbar-btn-decfont',
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-decfont',
lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock]
});
me.paragraphControls.push(me.btnDecFontSize);
me.btnBold = new Common.UI.Button({
id: 'id-toolbar-btn-bold',
cls: 'btn-toolbar',
@ -850,7 +866,7 @@ define([
].join(''));
this.lockControls = [this.btnChangeSlide, this.btnSave,
this.btnCopy, this.btnPaste, this.btnUndo, this.btnRedo, this.cmbFontName, this.cmbFontSize,
this.btnCopy, this.btnPaste, this.btnUndo, this.btnRedo, this.cmbFontName, this.cmbFontSize, this.btnIncFontSize, this.btnDecFontSize,
this.btnBold, this.btnItalic, this.btnUnderline, this.btnStrikeout, this.btnSuperscript,
this.btnSubscript, this.btnFontColor, this.btnClearStyle, this.btnCopyStyle, this.btnMarkers,
this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign,
@ -960,6 +976,8 @@ define([
_injectComponent('#slot-btn-strikeout', this.btnStrikeout);
_injectComponent('#slot-btn-superscript', this.btnSuperscript);
_injectComponent('#slot-btn-subscript', this.btnSubscript);
_injectComponent('#slot-btn-incfont', this.btnIncFontSize);
_injectComponent('#slot-btn-decfont', this.btnDecFontSize);
_injectComponent('#slot-btn-fontcolor', this.btnFontColor);
_injectComponent('#slot-btn-clearstyle', this.btnClearStyle);
_injectComponent('#slot-btn-copystyle', this.btnCopyStyle);
@ -1072,6 +1090,8 @@ define([
this.btnRedo.updateHint(this.tipRedo + Common.Utils.String.platformKey('Ctrl+Y'));
this.btnCopy.updateHint(this.tipCopy + Common.Utils.String.platformKey('Ctrl+C'));
this.btnPaste.updateHint(this.tipPaste + Common.Utils.String.platformKey('Ctrl+V'));
this.btnIncFontSize.updateHint(this.tipIncFont + Common.Utils.String.platformKey('Ctrl+]'));
this.btnDecFontSize.updateHint(this.tipDecFont + Common.Utils.String.platformKey('Ctrl+['));
this.btnBold.updateHint(this.textBold + Common.Utils.String.platformKey('Ctrl+B'));
this.btnItalic.updateHint(this.textItalic + Common.Utils.String.platformKey('Ctrl+I'));
this.btnUnderline.updateHint(this.textUnderline + Common.Utils.String.platformKey('Ctrl+U'));
@ -1682,7 +1702,9 @@ define([
capInsertAudio: 'Audio',
capInsertVideo: 'Video',
tipInsertAudio: 'Insert audio',
tipInsertVideo: 'Insert video'
tipInsertVideo: 'Insert video',
tipIncFont: 'Increment font size',
tipDecFont: 'Decrement font size'
}
}()), PE.Views.Toolbar || {}));
});

View file

@ -1908,5 +1908,7 @@
"PE.Views.Toolbar.txtScheme8": "Flow",
"PE.Views.Toolbar.txtScheme9": "Foundry",
"PE.Views.Toolbar.txtSlideAlign": "Align to Slide",
"PE.Views.Toolbar.txtUngroup": "Ungroup"
"PE.Views.Toolbar.txtUngroup": "Ungroup",
"PE.Views.Toolbar.tipIncFont": "Increment font size",
"PE.Views.Toolbar.tipDecFont": "Decrement font size"
}

View file

@ -141,3 +141,7 @@
.background-ximage('../../../../../../sdkjs/common/Images/themes_thumbnail.png', '../../../../../../sdkjs/common/Images/themes_thumbnail@2x.png', 85px);
background-size: cover
}
#slot-btn-incfont, #slot-btn-decfont {
margin-left: 2px;
}