[SSE mobile] Added function info
This commit is contained in:
parent
78cdc5f873
commit
a7311327f8
|
@ -878,12 +878,10 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
}
|
||||
|
||||
.functions-list {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
height: 175px;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: @white;
|
||||
.list {
|
||||
|
@ -898,7 +896,7 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
padding-left: calc(var(--f7-list-item-padding-horizontal) + var(--f7-safe-area-left) - var(--menu-list-offset));
|
||||
}
|
||||
.item-title {
|
||||
font-size: 14px;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
|
||||
import React, { useState } from 'react';
|
||||
import { Input, View, Button, Link, Popover, ListItem, List } from 'framework7-react';
|
||||
import { Input, View, Button, Link, Popover, ListItem, List, Icon, f7 } from 'framework7-react';
|
||||
import {observer, inject} from "mobx-react";
|
||||
// import {PageFunctionInfo} from "./add/AddFunction";
|
||||
import { __interactionsRef } from 'scheduler/tracing';
|
||||
import { Device } from '../../../../common/mobile/utils/device';
|
||||
|
||||
const viewStyle = {
|
||||
height: 30
|
||||
|
@ -13,7 +16,10 @@ const contentStyle = {
|
|||
|
||||
const CellEditorView = props => {
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const isPhone = Device.isPhone;
|
||||
const storeAppOptions = props.storeAppOptions;
|
||||
const storeFunctions = props.storeFunctions;
|
||||
const functions = storeFunctions.functions;
|
||||
const isEdit = storeAppOptions.isEdit;
|
||||
const funcArr = props.funcArr;
|
||||
|
||||
|
@ -35,11 +41,28 @@ const CellEditorView = props => {
|
|||
<Link icon="caret" onClick={expandClick} />
|
||||
</div>
|
||||
{funcArr && funcArr.length &&
|
||||
<div id="idx-functions-list" className="functions-list">
|
||||
<div id="idx-functions-list" className="functions-list" style={{left: isPhone ? '0' : '132px', width: isPhone ? '100%' : '360px'}}>
|
||||
<List>
|
||||
{funcArr.map((elem, index) => {
|
||||
return (
|
||||
<ListItem key={index} title={elem.name} onClick={() => props.insertFormula(elem.name, elem.type)}></ListItem>
|
||||
<ListItem key={index} title={elem.name} className="no-indicator" onClick={() => props.insertFormula(elem.name, elem.type)}>
|
||||
<div slot='after'
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
let functionInfo = functions[elem.name];
|
||||
|
||||
if(functionInfo) {
|
||||
f7.dialog.create({
|
||||
title: functionInfo.caption,
|
||||
content: `<h3>${functionInfo.caption} ${functionInfo.args}</h3>
|
||||
<p>${functionInfo.descr}</p>`,
|
||||
buttons: [{text: 'Ok'}]
|
||||
}).open();
|
||||
}
|
||||
}}>
|
||||
<Icon icon='icon-info'/>
|
||||
</div>
|
||||
</ListItem>
|
||||
)
|
||||
})}
|
||||
</List>
|
||||
|
@ -48,4 +71,4 @@ const CellEditorView = props => {
|
|||
</View>;
|
||||
};
|
||||
|
||||
export default inject("storeAppOptions")(observer(CellEditorView));
|
||||
export default inject("storeAppOptions", "storeFunctions")(observer(CellEditorView));
|
||||
|
|
Loading…
Reference in a new issue