Merge pull request #1835 from ONLYOFFICE/fix/bugfix
[DE][PE] Fix subscript/superscript
This commit is contained in:
commit
1aa51adb56
|
@ -495,8 +495,8 @@ define([
|
|||
|
||||
onApiVerticalAlign: function(typeBaseline) {
|
||||
if (this._state.valign !== typeBaseline) {
|
||||
this.toolbar.btnSuperscript.toggle(typeBaseline==1, true);
|
||||
this.toolbar.btnSubscript.toggle(typeBaseline==2, true);
|
||||
this.toolbar.btnSuperscript.toggle(typeBaseline==Asc.vertalign_SuperScript, true);
|
||||
this.toolbar.btnSubscript.toggle(typeBaseline==Asc.vertalign_SubScript, true);
|
||||
this._state.valign = typeBaseline;
|
||||
}
|
||||
},
|
||||
|
@ -1186,7 +1186,7 @@ define([
|
|||
if (!this.toolbar.btnSubscript.pressed) {
|
||||
this._state.valign = undefined;
|
||||
if (this.api)
|
||||
this.api.put_TextPrBaseline(btn.pressed ? 1 : 0);
|
||||
this.api.put_TextPrBaseline(btn.pressed ? Asc.vertalign_SuperScript : Asc.vertalign_Baseline);
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Superscript');
|
||||
|
@ -1197,7 +1197,7 @@ define([
|
|||
if (!this.toolbar.btnSuperscript.pressed) {
|
||||
this._state.valign = undefined;
|
||||
if (this.api)
|
||||
this.api.put_TextPrBaseline(btn.pressed ? 2 : 0);
|
||||
this.api.put_TextPrBaseline(btn.pressed ? Asc.vertalign_SubScript : Asc.vertalign_Baseline);
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Subscript');
|
||||
|
|
|
@ -119,9 +119,9 @@ class EditTextController extends Component {
|
|||
const api = Common.EditorApi.get();
|
||||
if (api) {
|
||||
if ('superscript' === type) {
|
||||
api.put_TextPrBaseline(value ? 1 : 0);
|
||||
api.put_TextPrBaseline(value ? Asc.vertalign_SuperScript : Asc.vertalign_Baseline);
|
||||
} else {
|
||||
api.put_TextPrBaseline(value ? 2 : 0);
|
||||
api.put_TextPrBaseline(value ? Asc.vertalign_SubScript : Asc.vertalign_Baseline);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,10 +171,10 @@ export class storeTextSettings {
|
|||
this.typeBaseline = typeBaseline;
|
||||
}
|
||||
get isSuperscript() {
|
||||
return (this.typeBaseline === 1);
|
||||
return (this.typeBaseline === Asc.vertalign_SuperScript);
|
||||
}
|
||||
get isSubscript() {
|
||||
return (this.typeBaseline === 2);
|
||||
return (this.typeBaseline === Asc.vertalign_SubScript);
|
||||
}
|
||||
|
||||
// bullets
|
||||
|
|
|
@ -471,8 +471,8 @@ define([
|
|||
|
||||
onApiVerticalAlign: function(typeBaseline) {
|
||||
if (this._state.valign !== typeBaseline) {
|
||||
this.toolbar.btnSuperscript.toggle(typeBaseline==1, true);
|
||||
this.toolbar.btnSubscript.toggle(typeBaseline==2, true);
|
||||
this.toolbar.btnSuperscript.toggle(typeBaseline==Asc.vertalign_SuperScript, true);
|
||||
this.toolbar.btnSubscript.toggle(typeBaseline==Asc.vertalign_SubScript, true);
|
||||
this._state.valign = typeBaseline;
|
||||
}
|
||||
},
|
||||
|
@ -1194,7 +1194,7 @@ define([
|
|||
if (!this.toolbar.btnSubscript.pressed) {
|
||||
this._state.valign = undefined;
|
||||
if (this.api)
|
||||
this.api.put_TextPrBaseline(btn.pressed ? 1 : 0);
|
||||
this.api.put_TextPrBaseline(btn.pressed ? Asc.vertalign_SuperScript : Asc.vertalign_Baseline);
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Superscript');
|
||||
|
@ -1205,7 +1205,7 @@ define([
|
|||
if (!this.toolbar.btnSuperscript.pressed) {
|
||||
this._state.valign = undefined;
|
||||
if (this.api)
|
||||
this.api.put_TextPrBaseline(btn.pressed ? 2 : 0);
|
||||
this.api.put_TextPrBaseline(btn.pressed ? Asc.vertalign_SubScript : Asc.vertalign_Baseline);
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Subscript');
|
||||
|
|
|
@ -204,9 +204,9 @@ class EditTextController extends Component {
|
|||
const api = Common.EditorApi.get();
|
||||
|
||||
if ('superscript' === type) {
|
||||
api.put_TextPrBaseline(value ? 1 : 0);
|
||||
api.put_TextPrBaseline(value ? Asc.vertalign_SuperScript : Asc.vertalign_Baseline);
|
||||
} else {
|
||||
api.put_TextPrBaseline(value ? 2 : 0);
|
||||
api.put_TextPrBaseline(value ? Asc.vertalign_SubScript : Asc.vertalign_Baseline);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -191,11 +191,11 @@ export class storeTextSettings {
|
|||
}
|
||||
|
||||
get isSuperscript() {
|
||||
return (this.typeBaseline === 1);
|
||||
return (this.typeBaseline === Asc.vertalign_SuperScript);
|
||||
}
|
||||
|
||||
get isSubscript() {
|
||||
return (this.typeBaseline === 2);
|
||||
return (this.typeBaseline === Asc.vertalign_SubScript);
|
||||
}
|
||||
|
||||
// bullets
|
||||
|
|
Loading…
Reference in a new issue