Merge pull request 'Added strikethrough button in mobile' (#618) from feature/strikethrough-btn into release/v9.1.0

This commit is contained in:
Julia Radzhabova
2025-08-18 08:16:41 +00:00
6 changed files with 22 additions and 0 deletions

View File

@ -80,6 +80,11 @@ class EditCellController extends Component {
api.asc_setCellUnderline(value);
}
toggleStrikethrough(value) {
const api = Common.EditorApi.get();
api.asc_setCellStrikeout(value);
}
onStyleClick(type) {
const api = Common.EditorApi.get();
api.asc_setCellStyle(type);
@ -238,6 +243,7 @@ class EditCellController extends Component {
toggleBold={this.toggleBold}
toggleItalic={this.toggleItalic}
toggleUnderline={this.toggleUnderline}
toggleStrikethrough={this.toggleStrikethrough}
onStyleClick={this.onStyleClick}
onTextColor={this.onTextColor}
onFillColor={this.onFillColor}

View File

@ -24,6 +24,11 @@ class EditTextController extends Component {
api.asc_setCellUnderline(value);
};
toggleStrikethrough(value) {
const api = Common.EditorApi.get();
api.asc_setCellStrikeout(value);
}
onParagraphAlign(type) {
const api = Common.EditorApi.get();
let value = AscCommon.align_Left;
@ -103,6 +108,7 @@ class EditTextController extends Component {
toggleBold={this.toggleBold}
toggleItalic={this.toggleItalic}
toggleUnderline={this.toggleUnderline}
toggleStrikethrough={this.toggleStrikethrough}
onParagraphAlign={this.onParagraphAlign}
onParagraphValign={this.onParagraphValign}
changeFontSize={this.changeFontSize}

View File

@ -15,6 +15,7 @@ export class storeCellSettings {
isBold: observable,
isItalic: observable,
isUnderline: observable,
isStrikethrough: observable,
hAlignStr: observable,
vAlignStr: observable,
isWrapText: observable,
@ -62,6 +63,7 @@ export class storeCellSettings {
isBold = false;
isItalic = false;
isUnderline = false;
isStrikethrough = false;
hAlignStr = 'left';
vAlignStr = 'bottom';
@ -146,6 +148,7 @@ export class storeCellSettings {
this.isBold = xfs.asc_getFontBold();
this.isItalic = xfs.asc_getFontItalic();
this.isUnderline = xfs.asc_getFontUnderline();
this.isStrikethrough = xfs.asc_getFontStrikeout();
}
initEditorFonts(fonts, select) {

View File

@ -12,6 +12,7 @@ export class storeTextSettings {
isBold: observable,
isItalic: observable,
isUnderline: observable,
isStrikethrough: observable,
textColor: observable,
customTextColors: observable,
paragraphAlign: observable,
@ -53,6 +54,7 @@ export class storeTextSettings {
isBold = false;
isItalic = false;
isUnderline = false;
isStrikethrough = false;
textColor = undefined;
customTextColors = [];
paragraphAlign = undefined;
@ -79,6 +81,7 @@ export class storeTextSettings {
this.isBold = xfs.asc_getFontBold();
this.isItalic = xfs.asc_getFontItalic();
this.isUnderline = xfs.asc_getFontUnderline();
this.isStrikethrough = xfs.asc_getFontStrikeout();
let color = xfs.asc_getFontColor();
// console.log(color);

View File

@ -73,6 +73,7 @@ const EditCell = props => {
const isBold = storeCellSettings.isBold;
const isItalic = storeCellSettings.isItalic;
const isUnderline = storeCellSettings.isUnderline;
const isStrikethrough = storeCellSettings.isStrikethrough;
const fontColorPreview = fontColor !== 'auto' ?
<span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> :
@ -98,6 +99,7 @@ const EditCell = props => {
<a className={'button' + (isBold ? ' active' : '')} onClick={() => {props.toggleBold(!isBold)}}><b>B</b></a>
<a className={'button' + (isItalic ? ' active' : '')} onClick={() => {props.toggleItalic(!isItalic)}}><i>I</i></a>
<a className={'button' + (isUnderline ? ' active' : '')} onClick={() => {props.toggleUnderline(!isUnderline)}} style={{textDecoration: "underline"}}>U</a>
<a className={'button' + (isStrikethrough ? ' active' : '')} onClick={() => {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S</a>
</div>
</ListItem>
<ListItem title={_t.textTextColor} link="/edit-cell-text-color/" routeProps={{

View File

@ -39,6 +39,7 @@ const EditText = props => {
const isBold = storeTextSettings.isBold;
const isItalic = storeTextSettings.isItalic;
const isUnderline = storeTextSettings.isUnderline;
const isStrikethrough = storeTextSettings.isStrikethrough;
const paragraphAlign = storeTextSettings.paragraphAlign;
const paragraphValign = storeTextSettings.paragraphValign;
@ -58,6 +59,7 @@ const EditText = props => {
<a className={'button' + (isBold ? ' active' : '')} onClick={() => {props.toggleBold(!isBold)}}><b>B</b></a>
<a className={'button' + (isItalic ? ' active' : '')} onClick={() => {props.toggleItalic(!isItalic)}}><i>I</i></a>
<a className={'button' + (isUnderline ? ' active' : '')} onClick={() => {props.toggleUnderline(!isUnderline)}} style={{textDecoration: "underline"}}>U</a>
<a className={'button' + (isStrikethrough ? ' active' : '')} onClick={() => {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S</a>
</div>
</ListItem>
<ListItem title={_t.textTextColor} link="/edit-text-font-color/" routeProps={{