[DE mobile] Some edits toc

This commit is contained in:
SergeyEzhin 2022-02-16 17:54:28 +04:00
parent 486ccc7f01
commit 534392b9c2
5 changed files with 23 additions and 7 deletions

View file

@ -18,6 +18,7 @@
--f7-navbar-text-color: @fill-white; --f7-navbar-text-color: @fill-white;
--f7-navbar-height: 56px; --f7-navbar-height: 56px;
--f7-list-bg-color: @background-primary;
--f7-subnavbar-bg-color: @toolbar-background; --f7-subnavbar-bg-color: @toolbar-background;
--f7-subnavbar-link-color: @toolbar-icons; --f7-subnavbar-link-color: @toolbar-icons;
--f7-subnavbar-text-color: @fill-white; --f7-subnavbar-text-color: @fill-white;
@ -84,7 +85,6 @@
--f7-input-placeholder-color: @text-secondary; --f7-input-placeholder-color: @text-secondary;
--f7-label-text-color: @text-normal; --f7-label-text-color: @text-normal;
--f7-page-bg-color: @background-tertiary; --f7-page-bg-color: @background-tertiary;
--f7-list-bg-color: @background-primary;
--f7-list-item-border-color: @background-menu-divider; --f7-list-item-border-color: @background-menu-divider;
--f7-list-chevron-icon-color: @text-tertiary; --f7-list-chevron-icon-color: @text-tertiary;
--f7-toggle-inactive-color: @background-menu-divider; --f7-toggle-inactive-color: @background-menu-divider;

View file

@ -336,7 +336,7 @@
"textType": "Type", "textType": "Type",
"textWe": "We", "textWe": "We",
"textWrap": "Wrap", "textWrap": "Wrap",
"textTableOfCont": "Table Of Cont.", "textTableOfCont": "TOC",
"textPageNumbers": "Page Numbers", "textPageNumbers": "Page Numbers",
"textSimple": "Simple", "textSimple": "Simple",
"textRightAlign": "Right Align", "textRightAlign": "Right Align",

View file

@ -6,6 +6,7 @@ import {AddTableContents} from '../../view/add/AddTableContents';
class AddTableContentsController extends Component { class AddTableContentsController extends Component {
constructor (props) { constructor (props) {
super(props); super(props);
this.onTableContents = this.onTableContents.bind(this);
} }
closeModal () { closeModal () {
@ -18,7 +19,8 @@ class AddTableContentsController extends Component {
componentDidMount () { componentDidMount () {
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
api.asc_getButtonsTOC('toc1', 'toc2'); const widthImage = !Device.phone ? 330 : window.innerWidth - 30;
api.asc_getButtonsTOC('toc1', 'toc2', widthImage);
} }
onTableContents(type, currentTOC) { onTableContents(type, currentTOC) {
@ -49,6 +51,8 @@ class AddTableContentsController extends Component {
api.asc_AddTableOfContents(null, props); api.asc_AddTableOfContents(null, props);
break; break;
} }
this.closeModal();
} }
render () { render () {

View file

@ -11,6 +11,16 @@ class EditTableContentsController extends Component {
this.startLevel = 1; this.startLevel = 1;
this.endLevel = 3; this.endLevel = 3;
this.fillTOCProps = this.fillTOCProps.bind(this); this.fillTOCProps = this.fillTOCProps.bind(this);
this.onRemoveTableContents = this.onRemoveTableContents.bind(this);
this.onUpdateTableContents = this.onUpdateTableContents.bind(this);
}
closeModal() {
if (Device.phone) {
f7.sheet.close('#edit-sheet', true);
} else {
f7.popover.close('#edit-popover');
}
} }
getStylesImages() { getStylesImages() {
@ -224,7 +234,7 @@ class EditTableContentsController extends Component {
api.asc_SetTableOfContentsPr(propsTableContents); api.asc_SetTableOfContentsPr(propsTableContents);
} }
onTableContentsUpdate(type, currentTOC) { onUpdateTableContents(type, currentTOC) {
const api = Common.EditorApi.get(); const api = Common.EditorApi.get();
let props = api.asc_GetTableOfContentsPr(currentTOC); let props = api.asc_GetTableOfContentsPr(currentTOC);
@ -242,13 +252,15 @@ class EditTableContentsController extends Component {
currentTOC = (currentTOC && props) ? props.get_InternalClass() : undefined; currentTOC = (currentTOC && props) ? props.get_InternalClass() : undefined;
api.asc_RemoveTableOfContents(currentTOC); api.asc_RemoveTableOfContents(currentTOC);
this.closeModal();
} }
render () { render () {
return ( return (
<EditTableContents <EditTableContents
onStyle={this.onStyle} onStyle={this.onStyle}
onTableContentsUpdate={this.onTableContentsUpdate} onUpdateTableContents={this.onUpdateTableContents}
onRemoveTableContents={this.onRemoveTableContents} onRemoveTableContents={this.onRemoveTableContents}
onPageNumbers={this.onPageNumbers} onPageNumbers={this.onPageNumbers}
onRightAlign={this.onRightAlign} onRightAlign={this.onRightAlign}

View file

@ -48,11 +48,11 @@ const EditTableContents = props => {
[ [
{ {
text: t('Edit.textRefreshEntireTable'), text: t('Edit.textRefreshEntireTable'),
onClick: () => props.onTableContentsUpdate('all') onClick: () => props.onUpdateTableContents('all')
}, },
{ {
text: t('Edit.textRefreshPageNumbersOnly'), text: t('Edit.textRefreshPageNumbersOnly'),
onClick: () => props.onTableContentsUpdate('pages') onClick: () => props.onUpdateTableContents('pages')
} }
], ],
[ [