Skip to content

Commit f5770c4

Browse files
Merge pull request #3888 from syncfusion-content/378201-wrap-tool-CM
378201: Added wrap text for toolbar on CoreMVC
2 parents 2e3fb4d + 65cf3b7 commit f5770c4

File tree

2 files changed

+28
-2
lines changed
  • ej2-asp-core-mvc/code-snippet/document-editor/custom-toolbar

2 files changed

+28
-2
lines changed

ej2-asp-core-mvc/code-snippet/document-editor/custom-toolbar/razor

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
var toolItem = {
99
prefixIcon: "e-de-ctnr-lock",
1010
tooltipText: "Disable Image",
11-
text: "Disable Image",
11+
text: onWrapText("Disable Image"),
1212
id: "Custom"
1313
};
1414
container.toolbarItems = [toolItem, 'Undo', 'Redo', 'Separator', 'Image', 'Table', 'Hyperlink', 'Bookmark', 'TableOfContents', 'Separator', 'Header', 'Footer', 'PageSetup', 'PageNumber', 'Break', 'InsertFootnote', 'InsertEndnote', 'Separator', 'Find', 'Separator', 'Comments', 'TrackChanges', 'Separator', 'LocalClipboard', 'RestrictEditing', 'Separator', 'FormFields', 'UpdateFields','ContentControl'];
@@ -21,4 +21,17 @@
2121
}
2222
};
2323
}
24+
25+
function onWrapText(text) {
26+
let content = '';
27+
const index = text.lastIndexOf(' ');
28+
29+
if (index !== -1) {
30+
content = text.slice(0, index) + "<div class='e-de-text-wrap'>" + text.slice(index + 1) + "</div>";
31+
} else {
32+
content = text;
33+
}
34+
35+
return content;
36+
}
2437
</script>

ej2-asp-core-mvc/code-snippet/document-editor/custom-toolbar/tagHelper

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var toolItem = {
66
prefixIcon: "e-de-ctnr-lock",
77
tooltipText: "Disable Image",
8-
text: "Disable Image",
8+
text: onWrapText("Disable Image"),
99
id: "Custom"
1010
};
1111
container.toolbarItems = [toolItem, 'Undo', 'Redo', 'Separator', 'Image', 'Table', 'Hyperlink', 'Bookmark', 'TableOfContents', 'Separator', 'Header', 'Footer', 'PageSetup', 'PageNumber', 'Break', 'InsertFootnote', 'InsertEndnote', 'Separator', 'Find', 'Separator', 'Comments', 'TrackChanges', 'Separator', 'LocalClipboard', 'RestrictEditing', 'Separator', 'FormFields', 'UpdateFields','ContentControl'];
@@ -18,4 +18,17 @@
1818
}
1919
};
2020
}
21+
22+
function onWrapText(text) {
23+
let content = '';
24+
const index = text.lastIndexOf(' ');
25+
26+
if (index !== -1) {
27+
content = text.slice(0, index) + "<div class='e-de-text-wrap'>" + text.slice(index + 1) + "</div>";
28+
} else {
29+
content = text;
30+
}
31+
32+
return content;
33+
}
2134
</script>

0 commit comments

Comments
 (0)