[PE mobile] Fixed Presentation Settings according to mobx v. 6
This commit is contained in:
parent
5d06b05a51
commit
e47157f949
|
@ -36,12 +36,6 @@ class PESearchView extends SearchView {
|
||||||
|
|
||||||
onSearchbarShow(isshowed, bar) {
|
onSearchbarShow(isshowed, bar) {
|
||||||
super.onSearchbarShow(isshowed, bar);
|
super.onSearchbarShow(isshowed, bar);
|
||||||
|
|
||||||
// const api = Common.EditorApi.get();
|
|
||||||
// if ( isshowed ) {
|
|
||||||
// const checkboxMarkResults = f7.toggle.get('.toggle-mark-results');
|
|
||||||
// api.asc_selectSearchingResults(checkboxMarkResults.checked);
|
|
||||||
// } else api.asc_selectSearchingResults(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,19 @@ class PresentationSettingsController extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.initSlideSize = this.initSlideSize.bind(this);
|
this.initSlideSize = this.initSlideSize.bind(this);
|
||||||
this.onSlideSize = this.onSlideSize.bind(this);
|
this.onSlideSize = this.onSlideSize.bind(this);
|
||||||
|
this.initSlideSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
initSlideSize() {
|
initSlideSize() {
|
||||||
if (!this.init) {
|
if (!this.init) {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
const slideSizes = [
|
||||||
|
[9144000, 6858000, Asc.c_oAscSlideSZType.SzScreen4x3],
|
||||||
|
[12192000, 6858000, Asc.c_oAscSlideSZType.SzCustom]
|
||||||
|
];
|
||||||
|
|
||||||
this.props.storePresentationSettings.changeSizeIndex(api.get_PresentationWidth(), api.get_PresentationHeight());
|
this.props.storePresentationSettings.changeSizeIndex(api.get_PresentationWidth(), api.get_PresentationHeight());
|
||||||
|
this.props.storePresentationSettings.initSlideSizes(slideSizes);
|
||||||
this.init = true;
|
this.init = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
import {action, observable} from 'mobx';
|
import {action, observable, makeObservable} from 'mobx';
|
||||||
|
|
||||||
export class storePresentationSettings {
|
export class storePresentationSettings {
|
||||||
@observable slideSizes = [
|
constructor() {
|
||||||
[9144000, 6858000, Asc.c_oAscSlideSZType.SzScreen4x3],
|
makeObservable(this, {
|
||||||
[12192000, 6858000, Asc.c_oAscSlideSZType.SzCustom]
|
slideSizes: observable,
|
||||||
];
|
currentPageSize: observable,
|
||||||
|
slideSizeIndex: observable,
|
||||||
|
allSchemes: observable,
|
||||||
|
changeSizeIndex: action,
|
||||||
|
addSchemes: action,
|
||||||
|
initSlideSizes: action
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@observable currentPageSize;
|
slideSizes = [];
|
||||||
@observable slideSizeIndex;
|
currentPageSize;
|
||||||
|
slideSizeIndex;
|
||||||
|
|
||||||
@action changeSizeIndex(width, height) {
|
changeSizeIndex(width, height) {
|
||||||
this.currentPageSize = {width, height};
|
this.currentPageSize = {width, height};
|
||||||
let ratio = height / width;
|
let ratio = height / width;
|
||||||
|
|
||||||
|
@ -20,11 +28,15 @@ export class storePresentationSettings {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initSlideSizes(value) {
|
||||||
|
this.slideSizes = value;
|
||||||
|
}
|
||||||
|
|
||||||
// Color Schemes
|
// Color Schemes
|
||||||
|
|
||||||
@observable allSchemes;
|
allSchemes;
|
||||||
|
|
||||||
@action addSchemes(arr) {
|
addSchemes(arr) {
|
||||||
this.allSchemes = arr;
|
this.allSchemes = arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { useTranslation } from "react-i18next";
|
||||||
const PagePresentationSettings = props => {
|
const PagePresentationSettings = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t("View.Settings", { returnObjects: true });
|
const _t = t("View.Settings", { returnObjects: true });
|
||||||
props.initSlideSize();
|
|
||||||
const storePresentationSettings = props.storePresentationSettings;
|
const storePresentationSettings = props.storePresentationSettings;
|
||||||
const slideSizeArr = storePresentationSettings.slideSizes;
|
const slideSizeArr = storePresentationSettings.slideSizes;
|
||||||
const slideSizeIndex = storePresentationSettings.slideSizeIndex;
|
const slideSizeIndex = storePresentationSettings.slideSizeIndex;
|
||||||
|
|
Loading…
Reference in a new issue