@sapui5/sap.ui.richtexteditor 1.98.0 → 1.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<vendor>SAP SE</vendor>
|
|
6
6
|
<copyright>SAPUI5
|
|
7
7
|
* (c) Copyright 2009-2022 SAP SE. All rights reserved.</copyright>
|
|
8
|
-
<version>1.
|
|
8
|
+
<version>1.99.0</version>
|
|
9
9
|
|
|
10
10
|
<documentation>A rich text editor (RTE) control. Requires installation of an additional rich text editor library.</documentation>
|
|
11
11
|
|
|
@@ -199,22 +199,10 @@ sap.ui.define([
|
|
|
199
199
|
ToolbarWrapper.prototype.modifyRTEToolbarConfig = function (oConfig) {
|
|
200
200
|
var oToolbar = this;
|
|
201
201
|
|
|
202
|
-
// Sync the default text justification with the text direction set in the config
|
|
203
|
-
var sTextAlign = oConfig.directionality === "rtl" ? "JustifyRight" : "JustifyLeft";
|
|
204
202
|
// Remove the native toolbar. From now on the sap.ui.richtexteditor.ToolbarWrapper will be used
|
|
205
203
|
oConfig.toolbar = false;
|
|
206
204
|
|
|
207
205
|
oConfig.setup = function (editor) {
|
|
208
|
-
editor.on('init', function () {
|
|
209
|
-
var oEditorCommands = library.EditorCommands;
|
|
210
|
-
|
|
211
|
-
// execute the default font styles to ensure right synchronizing of the custom toolbar
|
|
212
|
-
// prevent tinymce from stealing the focus
|
|
213
|
-
editor.execCommand("FormatBlock", false, oEditorCommands["FormatBlock"]["Paragraph"].commandValue, {skip_focus: true});
|
|
214
|
-
editor.execCommand(sTextAlign, false, null, {skip_focus: true});
|
|
215
|
-
editor.execCommand("FontName", false, oEditorCommands["FontFamily"]["Verdana"].commandValue, {skip_focus: true});
|
|
216
|
-
editor.execCommand("FontSize", false, "10pt", {skip_focus: true});
|
|
217
|
-
});
|
|
218
206
|
|
|
219
207
|
// Sync sap.ui.richtexteditor.ToolbarWrapper buttons with the editor
|
|
220
208
|
editor.on('NodeChange', function () {
|
|
@@ -1441,6 +1429,7 @@ sap.ui.define([
|
|
|
1441
1429
|
oEditorHelper.createSelect({
|
|
1442
1430
|
id: this._getId("FontFamily"),
|
|
1443
1431
|
ariaLabelledBy: oInvisibleTextFontFamily,
|
|
1432
|
+
selectedItemId: this._getId("FontFamilyVerdana"),
|
|
1444
1433
|
items: this._createFontStyleSelectItems(),
|
|
1445
1434
|
change: function (oEvent) {
|
|
1446
1435
|
var oItem;
|
|
@@ -1459,6 +1448,7 @@ sap.ui.define([
|
|
|
1459
1448
|
oEditorHelper.createSelect({
|
|
1460
1449
|
id: this._getId("FontSize"),
|
|
1461
1450
|
ariaLabelledBy: oInvisibleTextFontSize,
|
|
1451
|
+
selectedItemId: this._getId("FontSize2"),
|
|
1462
1452
|
items: this._createFontSizeSelectItems(),
|
|
1463
1453
|
change: function (oEvent) {
|
|
1464
1454
|
var oItem;
|
|
@@ -1483,6 +1473,8 @@ sap.ui.define([
|
|
|
1483
1473
|
break;
|
|
1484
1474
|
case "text-align":
|
|
1485
1475
|
bVisibleGroupTextAlign = oRTE ? oRTE.getShowGroupTextAlign() : false;
|
|
1476
|
+
var bTextAlignLRight = oRTE._getTextDirection() === "rtl";
|
|
1477
|
+
var iDefaultItemIndex = bTextAlignLRight ? 2 : 0;
|
|
1486
1478
|
var aMenuItems = this._createMenuButtonItems("TextAlign");
|
|
1487
1479
|
aContent.push(
|
|
1488
1480
|
oEditorHelper.createMenuButton(
|
|
@@ -1496,9 +1488,10 @@ sap.ui.define([
|
|
|
1496
1488
|
oEditor = oRTE.getNativeApi();
|
|
1497
1489
|
oSelectedItemIcon = oSelectedItem.getIcon();
|
|
1498
1490
|
if (oSelectedItemIcon === this.getParent().getIcon()) {
|
|
1491
|
+
var sTextAlign = bTextAlignLRight ? "JustifyRight" : "JustifyLeft";
|
|
1499
1492
|
// Text Align commands in TinyMCE have a toggle behavior when you set a
|
|
1500
1493
|
// certain command twice the default command (text-align-left) will be applied
|
|
1501
|
-
oEditor.execCommand(
|
|
1494
|
+
oEditor.execCommand(sTextAlign);
|
|
1502
1495
|
} else {
|
|
1503
1496
|
oEditor.execCommand('Justify' + oToolbar._findTextAlignCommandByIcon(oSelectedItemIcon));
|
|
1504
1497
|
}
|
|
@@ -1506,7 +1499,7 @@ sap.ui.define([
|
|
|
1506
1499
|
Log.warning("Cannot execute native command: " + 'Justify');
|
|
1507
1500
|
}
|
|
1508
1501
|
},
|
|
1509
|
-
aMenuItems[
|
|
1502
|
+
aMenuItems[iDefaultItemIndex].getIcon(),
|
|
1510
1503
|
this._oResourceBundle.getText(oCommands["TextAlign"].bundleKey)
|
|
1511
1504
|
).setVisible(bVisibleGroupTextAlign)
|
|
1512
1505
|
);
|